Skip to content

Commit

Permalink
update auth (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
likehabits authored Sep 6, 2023
1 parent 29dd7a5 commit c1193f6
Showing 1 changed file with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,24 @@ public static FusionResourceVo fusionResourcePoConvertVo(FusionResource fusionRe
}
fusionResourceVo.setAvailable(1);
if (fusionResource.getIsDel() == 0 && fusionResource.getResourceState() == 0){
if (fusionResource.getResourceAuthType().equals(AuthTypeEnum.PRIVATE.getAuthType()) && fusionResource.getOrganId().equals(globalId)){
if (fusionResource.getOrganId().equals(globalId)){
fusionResourceVo.setAvailable(0);
}
if (fusionResource.getResourceAuthType().equals(AuthTypeEnum.VISIBILITY.getAuthType())){
if (!StringUtils.isEmpty(fusionResource.getAuthOrgans()) && !StringUtils.isEmpty(globalId)){
Set<String> authOrgansSet = Arrays.stream(fusionResource.getAuthOrgans().split(",")).collect(Collectors.toSet());
authOrgansSet.add(fusionResource.getOrganId());
if (authOrgansSet.contains(globalId)) {
fusionResourceVo.setAvailable(0);
}else {
if (fusionResource.getResourceAuthType().equals(AuthTypeEnum.PRIVATE.getAuthType()) && fusionResource.getOrganId().equals(globalId)){
fusionResourceVo.setAvailable(0);
}
if (fusionResource.getResourceAuthType().equals(AuthTypeEnum.VISIBILITY.getAuthType())){
if (!StringUtils.isEmpty(fusionResource.getAuthOrgans()) && !StringUtils.isEmpty(globalId)){
Set<String> authOrgansSet = Arrays.stream(fusionResource.getAuthOrgans().split(",")).collect(Collectors.toSet());
authOrgansSet.add(fusionResource.getOrganId());
if (authOrgansSet.contains(globalId)) {
fusionResourceVo.setAvailable(0);
}
}
}
}
if(fusionResource.getResourceAuthType().equals(AuthTypeEnum.PUBLIC.getAuthType())) {
fusionResourceVo.setAvailable(0);
if(fusionResource.getResourceAuthType().equals(AuthTypeEnum.PUBLIC.getAuthType())) {
fusionResourceVo.setAvailable(0);
}
}
}
fusionResourceVo.setOrganName(organName);
Expand Down

0 comments on commit c1193f6

Please sign in to comment.