PermissionController.php
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
+-----------------------------------------------------------------------------------------------------------------------
* 重写laravel-admin Auth控制类
+-----------------------------------------------------------------------------------------------------------------------
*
* @copyright Copyright
* @author Richer
* @package App\Admin\Controllers
* @version 2020年3月23日,14:13:13
* @link
*/
namespace App\Admin\Controllers\Auth;
use App\Admin\Controllers\BaseController;
use App\Admin\Forms\Admin\PermissionForm;
use App\Admin\Grids\Admin\PermissionGrid;
use App\Models\Admin\Permission;
class PermissionController extends BaseController
{
// 使用Grid和Form的trait
use PermissionGrid, PermissionForm;
/**
* RoleController constructor.
*
* @param Permission $model 注入model
*/
public function __construct(Permission $model)
{
// 资源显示的中名称
$this->title = $model::OBJ_NAME;
// 是否可查看
$this->can_view = false;
// 是否可新增
$this->can_create = true;
// 是否可编辑
$this->can_edit = true;
// 是否可删除
$this->can_delete = true;
// 执行父类构造方法
parent::__construct($model);
}
}