Skip to content

Commit

Permalink
fix(Permission): 修复后台权限注解解析逻辑 (#492)
Browse files Browse the repository at this point in the history
- 无需权限验证的接口,可不写 Permission 注解
  • Loading branch information
People-Sea authored Dec 9, 2024
1 parent 212b5eb commit c7598f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Http/Admin/Middleware/PermissionMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ private function check(Dispatched $dispatched): bool
*/
$permissions = [];
$classAnnotation && $permissions[] = $classAnnotation;
$permissions[] = Arr::get($annotations, Permission::class);
$methodPermission = Arr::get($annotations, Permission::class);
$methodPermission && $permissions[] = $methodPermission;
foreach ($permissions as $permission) {
$this->handlePermission($permission);
}
Expand Down

0 comments on commit c7598f6

Please sign in to comment.