Merge branch 'webman-php:main' into main
This commit is contained in:
commit
6b1b64a05d
@ -171,6 +171,11 @@ class RoleController extends Crud
|
|||||||
if (!Auth::isSupperAdmin() && array_diff($ids, Auth::getScopeRoleIds())) {
|
if (!Auth::isSupperAdmin() && array_diff($ids, Auth::getScopeRoleIds())) {
|
||||||
return $this->json(1, '无删除权限');
|
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);
|
$this->doDelete($ids);
|
||||||
return $this->json(0);
|
return $this->json(0);
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@ class AccessControl implements MiddlewareInterface
|
|||||||
EOF
|
EOF
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
$request->plugin = 'admin';
|
||||||
$response = view('common/error/403')->withStatus(403);
|
$response = view('common/error/403')->withStatus(403);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user