Skip to content

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

@Hccake

Description

@Hccake

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

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

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

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions