超管判断

This commit is contained in:
2026-08-17 11:22:47 +08:00
parent cf33feb7d0
commit 77a629ee64
2 changed files with 13 additions and 2 deletions
@@ -40,7 +40,7 @@ public class SchsystemController {
Integer roleId = UserContext.getRoleId();
boolean isSuperAdmin = UserType.SUPER_ADMINISTRATOR.getId().equals(UserContext.getType());
boolean isAreaAdmin = UserRole.AREAADMIN.getValue().equals(roleId);
boolean isAreaAdmin = !isSuperAdmin && UserRole.AREAADMIN.getValue().equals(roleId);
if (!isSuperAdmin && !isAreaAdmin) {
throw new DException("无权操作,仅超级管理员或学校管理员可设置学制");
@@ -82,7 +82,7 @@ public class SchsystemController {
// 2. 角色权限校验
Integer roleId = user.getRoleId();
boolean isSuperAdmin = UserType.SUPER_ADMINISTRATOR.getId().equals(UserContext.getType());
boolean isAreaAdmin = UserRole.AREAADMIN.getValue().equals(roleId);
boolean isAreaAdmin =!isSuperAdmin && UserRole.AREAADMIN.getValue().equals(roleId);
if (!isSuperAdmin && !isAreaAdmin) {
throw new DException("无权操作,仅超级管理员或学校管理员可设置学制");