mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-06 18:12:50 +08:00
实现手动设计的权限管理
This commit is contained in:
@@ -31,26 +31,6 @@ class Common extends BaseController{
|
||||
throw new HttpResponseException(redirect('admin/Login/index'));
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($this->adminInfo['group'])){
|
||||
|
||||
$current_access_info = [
|
||||
'app'=>app('http')->getName(),
|
||||
'controller'=>request()->controller(),
|
||||
'action'=>request()->action()
|
||||
];
|
||||
|
||||
$model_permission = AdminPermission::where($current_access_info)->find();
|
||||
|
||||
if(!empty($model_permission)){
|
||||
if(!in_array($model_permission->id,$this->adminInfo->group->permissions)){
|
||||
return $this->error('您没有访问权限');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
View::assign('admin',$this->adminInfo);
|
||||
|
||||
Reference in New Issue
Block a user