mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-11 16:57:12 +08:00
refactor: 优化角色分配功能相关代码
This commit is contained in:
@@ -35,17 +35,9 @@ public class SysConstants {
|
||||
public static final Integer YES = 1;
|
||||
|
||||
/**
|
||||
* 管理员角色编码
|
||||
* 超管用户 ID
|
||||
*/
|
||||
public static final String ADMIN_ROLE_CODE = "admin";
|
||||
/**
|
||||
* 超管角色组ID
|
||||
*/
|
||||
public static final Long SUPER_ROLE_ID = 1L;
|
||||
/**
|
||||
* 超管账号ID
|
||||
*/
|
||||
public static final Long SUPER_ADMIN_ID = 1L;
|
||||
public static final Long SUPER_USER_ID = 1L;
|
||||
|
||||
/**
|
||||
* 顶级部门 ID
|
||||
@@ -57,6 +49,16 @@ public class SysConstants {
|
||||
*/
|
||||
public static final Long SUPER_PARENT_ID = 0L;
|
||||
|
||||
/**
|
||||
* 超管角色编码
|
||||
*/
|
||||
public static final String SUPER_ROLE_CODE = "admin";
|
||||
|
||||
/**
|
||||
* 超管角色 ID
|
||||
*/
|
||||
public static final Long SUPER_ROLE_ID = 1L;
|
||||
|
||||
/**
|
||||
* 全部权限标识
|
||||
*/
|
||||
|
@@ -100,7 +100,7 @@ public class UserContext implements Serializable {
|
||||
if (CollUtil.isEmpty(roleCodes)) {
|
||||
return false;
|
||||
}
|
||||
return roleCodes.contains(SysConstants.ADMIN_ROLE_CODE);
|
||||
return roleCodes.contains(SysConstants.SUPER_ROLE_CODE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user