权限校验
This commit is contained in:
parent
24f08057f8
commit
00cfb2c7c3
|
@ -24,6 +24,10 @@ class CheckRole
|
|||
abort(403, '无权访问');
|
||||
}
|
||||
|
||||
if (is_string($roles[$action]) && $roles[$action] == '*') {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
if (empty(array_intersect($roles[$action], $user['roles']))) {
|
||||
abort(403, '无权访问,请联系管理员授权');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user