超管判断
This commit is contained in:
@@ -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("无权操作,仅超级管理员或学校管理员可设置学制");
|
||||
|
||||
Reference in New Issue
Block a user