Skip to content

Commit

Permalink
NPE bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Oct 25, 2024
1 parent 439ba2e commit 106a06e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/src/main/java/access/api/RoleController.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ public ResponseEntity<Void> deleteRole(@PathVariable("id") Long id,
manage.addManageMetaData(List.of(role));
UserPermissions.assertAuthority(user, Authority.INSTITUTION_ADMIN);

if (limitInstitutionAdminRoleVisibility && !user.getOrganizationGUID().equals(role.getOrganizationGUID())) {
if (limitInstitutionAdminRoleVisibility && !user.isSuperUser() &&
!Objects.equals(user.getOrganizationGUID(), role.getOrganizationGUID())) {
throw new UserRestrictionException();
}

Expand Down

0 comments on commit 106a06e

Please sign in to comment.