Merge branch 'webman-php:main' into main

This commit is contained in:
qnnp 2023-03-04 19:51:43 +08:00 committed by GitHub
commit 6b1b64a05d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -171,6 +171,11 @@ class RoleController extends Crud
if (!Auth::isSupperAdmin() && array_diff($ids, Auth::getScopeRoleIds())) {
return $this->json(1, '无删除权限');
}
$tree = new Tree(Role::get());
$descendants = $tree->getDescendant($ids);
if ($descendants) {
$ids = array_merge($ids, array_column($descendants, 'id'));
}
$this->doDelete($ids);
return $this->json(0);
}

View File

@ -42,6 +42,7 @@ class AccessControl implements MiddlewareInterface
EOF
);
} else {
$request->plugin = 'admin';
$response = view('common/error/403')->withStatus(403);
}
}