This commit is contained in:
候学杰 2018-02-07 15:55:27 +08:00
parent 07f84e259a
commit 7947cbe79b

View File

@ -80,6 +80,13 @@ class Authenticate
$match = []; $match = [];
foreach ($user['roles'] as $role) { foreach ($user['roles'] as $role) {
if (array_key_exists($role, $privileges)) { if (array_key_exists($role, $privileges)) {
//如果设置了 * ,则跳过权限检测
if (is_string($privileges[$role]) && $privileges[$role] == '*') {
return $next($request);
}
if (!is_array($privileges[$role])) {
throw new \Exception('pdauth 配置错误!');
}
$match = array_merge($match, $privileges[$role]); $match = array_merge($match, $privileges[$role]);
} }
} }