Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

超级管理员的权限判断优化 #209

Open
Hccake opened this issue Oct 9, 2022 · 0 comments
Open

超级管理员的权限判断优化 #209

Hccake opened this issue Oct 9, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Hccake
Copy link
Member

Hccake commented Oct 9, 2022

目前 ballcat 提供了超级管理员的配置文件, SystemProperties :

ballcat:
  system:
    administrator:
      user-id: 0
      username: xxx

可以指定超级管理员的用户 id 或者 用户名,超级管理员默认拥有所有的角色和权限。

目前的实现逻辑是在登陆时会赋值超级管理员所有的角色和权限,当角色较多时,返回数据量较大。可以简化为在登陆时给用户设置一个标志位,标识其是否是超级管理员。

服务端鉴权时,先判断标志位是否存在,是则直接返回 true,鉴权代码在 CustomPermissionEvaluator
前端鉴权逻辑也基本相同,先判断标志位,再判断是否有角色或者权限

@Hccake Hccake added the enhancement New feature or request label Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant