资源增加admin_id

This commit is contained in:
none
2023-03-13 10:36:36 +08:00
parent c254a42cc6
commit debcddc468
12 changed files with 79 additions and 39 deletions

View File

@@ -75,4 +75,16 @@ public class BackendBus {
return PrivacyUtil.desValue(value, 1, 0, "*");
}
public boolean isSuperAdmin() {
AdminRole superRole = adminRoleService.getBySlug(BackendConstant.SUPER_ADMIN_ROLE);
if (superRole == null) {
return false;
}
List<Integer> roleIds = adminUserService.getRoleIdsByUserId(PlayEduBContext.getAdminUserID());
if (roleIds.size() == 0) {
return false;
}
return roleIds.contains(superRole.getId());
}
}