用户登录不显示个人权限
This commit is contained in:
parent
75a1fa43cc
commit
eb81ea59dc
@ -142,33 +142,31 @@ public class PermissionSubjectService {
|
||||
//根据当前用户的项目code 获取所有的mapId
|
||||
List<Long> projectMapIdList = this.findMapIdByProjectCode(projectCode);
|
||||
List<SystemAbility> voList = this.systemAbilityService.findSystemAbilityByMapId(List.of(mapId));
|
||||
|
||||
List<PermissionSubjectVO> resultList = Lists.newArrayList();
|
||||
//过滤当前项目的权限
|
||||
//从当前用户所有权限获取所有权限类型为:PROJECT && 数据== 用户项目code && 项目code对应的所有mapId == mapId(入参)
|
||||
List<PermissionSubjectVO> projectVOList = subjectVOList.stream()
|
||||
List<PermissionSubjectVO> projectMapVOList = subjectVOList.stream()
|
||||
.filter(d->(Objects.equals(d.getPermissionType(), PermissionTypeEnum.PROJECT.getValue()))
|
||||
&& Objects.equals(d.getPermissionProjectCode(),projectCode.toLowerCase()) && projectMapIdList.contains(mapId))
|
||||
// && Objects.equals(d.getProjectCode(),projectCode.toLowerCase()) && projectMapIdList.contains(mapId))
|
||||
.collect(Collectors.toList());
|
||||
if(!CollectionUtils.isEmpty(projectVOList)){
|
||||
this.createSystemAbilityVOForProejctOrMap(projectVOList,voList);
|
||||
return projectVOList;
|
||||
if(!CollectionUtils.isEmpty(projectMapVOList)){
|
||||
this.createSystemAbilityVOForProejctOrMap(projectMapVOList,voList);
|
||||
resultList.addAll(projectMapVOList);
|
||||
}
|
||||
//过滤当前线路权限
|
||||
//当前是否是线路权限
|
||||
List<PermissionSubjectVO> mapVOList = subjectVOList.stream()
|
||||
List<PermissionSubjectVO> orgMapVOList = subjectVOList.stream()
|
||||
.filter(d->(Objects.equals(d.getPermissionType(), PermissionTypeEnum.MAP_ID.getValue()))
|
||||
&& Objects.equals(d.getMapId(), mapId)).collect(Collectors.toList());
|
||||
if(!CollectionUtils.isEmpty(mapVOList)){
|
||||
this.createSystemAbilityVOForProejctOrMap(mapVOList,voList);
|
||||
return mapVOList;
|
||||
}else {
|
||||
//过滤当前线路功能权限
|
||||
//过滤该用户拥有所有的权限并且mapId = 参数mapId
|
||||
subjectVOList = subjectVOList.stream().filter(d-> Objects.equals(d.getMapId(), mapId)).collect(Collectors.toList());
|
||||
this.createSystemAbilityVOForFunction(subjectVOList);
|
||||
return subjectVOList;
|
||||
if(!CollectionUtils.isEmpty(orgMapVOList)){
|
||||
this.createSystemAbilityVOForProejctOrMap(orgMapVOList,voList);
|
||||
resultList.addAll(orgMapVOList);
|
||||
}
|
||||
List<PermissionSubjectVO> abilityMapVOList = subjectVOList.stream().filter(d-> (Objects.equals(d.getPermissionType(), PermissionTypeEnum.MAP_ABILITY.getValue()))
|
||||
&& Objects.equals(d.getMapId(), mapId)).collect(Collectors.toList());
|
||||
this.createSystemAbilityVOForFunction(abilityMapVOList);
|
||||
resultList.addAll(abilityMapVOList);
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user