Browse Source

公告 只能编辑自己的 超管除外

master
PoffyZhang 1 year ago
parent
commit
76168c65a5
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java

+ 6
- 1
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java View File

@@ -333,10 +333,15 @@ public class NoticeManage {
}

private void permissionsWrapperByEdit(LambdaQueryWrapper<Notice> wrapper,UserFullInfoDTO user) {
UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail();
//如果是超管 就能看所有
if(user.getSuperAdmin()){
log.info(user.getUsername() + ",超管可以看所有");
}else if(user.getRegionAdmin()){
wrapper.eq(Notice::getPermissions,NoticePermissionsEnum.REGION.getCode())
.eq(Notice::getPermissionsValue,user.getRegionCode());
}else if(user.getIsOrgAdmin()){
wrapper.eq(Notice::getPermissions,NoticePermissionsEnum.ORG.getCode())
.eq(Notice::getPermissionsValue,user.getEmpPosUnitCode());
}else{
wrapper.eq(Notice::getCreateOn,user.getUserId());
}


Loading…
Cancel
Save