update 判断管理员角色使用loginUser的isAdmin

This commit is contained in:
lijiarao
2024-02-04 09:55:01 +08:00
parent c8bef50d41
commit 43881b113c
3 changed files with 4 additions and 5 deletions
@@ -298,10 +298,9 @@ public class ProcessAllService extends ServiceImpl<ProcessAllMapper, ProcessAll>
.map(ProcessApprovalRecord::getUserId)
.distinct()
.collect(Collectors.toList());
String loginUserId = CurrentUserUtil.getId();
String roleIds = CurrentUserUtil.getRoles();
LoginUser loginUser = CurrentUserUtil.getLoginUser();
//管理员和当前流程中人员可以催办
if (!roleIds.contains(FieldCommon.ROLE_ADMIN) && !canUrgingUserList.contains(loginUserId)){
if (!loginUser.getIsAdmin() && !canUrgingUserList.contains(loginUser.getId())){
throw new JeroBootException(ResultCommon.TASK_URGING_ERROR_2);
}
@@ -130,7 +130,7 @@ public class LawsEvaluationNotMetController extends JeroController<LawsEvaluatio
List<LawsEvaluationNotMet> notMets = lawsEvaluationNotMetService.listByIds(ids);
for (LawsEvaluationNotMet notMet : notMets) {
//管理员和设计工程师可以操作未符合项
if (!roleIds.contains(FieldCommon.ROLE_ADMIN) && !userId.equals(notMet.getEngineerId())){
if (!loginUser.getIsAdmin() && !userId.equals(notMet.getEngineerId())){
throw new JeroBootException(ResultCommon.NO_PERMISSIONS_PLEASE_SELECT);
}
String state = notMet.getState();
@@ -198,7 +198,7 @@ public class LawsEvaluationNotMetServiceImpl extends ServiceImpl<LawsEvaluationN
String roleIds = loginUser.getRoleIds();
String userId = loginUser.getId();
//管理员和设计工程师可以操作未符合项
if (!roleIds.contains(FieldCommon.ROLE_ADMIN) && !userId.equals(notMet.getEngineerId())){
if (!loginUser.getIsAdmin() && !userId.equals(notMet.getEngineerId())){
throw new JeroBootException(ResultCommon.NO_PERMISSIONS_PLEASE_SELECT);
}
}