Skip to content

Commit

Permalink
Update ManagePermissionsPage.java
Browse files Browse the repository at this point in the history
  • Loading branch information
scolapasta authored Feb 11, 2022
1 parent 53914de commit 73d7216
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,15 @@ public List<DataverseRole> getAvailableRoles() {
}

} else if (dvObject instanceof DataFile) {
// TODO: consider changing the logic here to be more like for Dataset
// in order to capture new roles that get added having only File scoped permissions
roles.add(roleService.findBuiltinRoleByAlias(DataverseRole.FILE_DOWNLOADER));
// only show roles that have File level permissions
// current the available roles for a file are gotten from its parent's parent
for (DataverseRole role : roleService.availableRoles(dvObject.getOwner().getOwner().getId())) {
for (Permission permission : role.permissions()) {
if (permission.appliesTo(DataFile.class)) {
roles.add(role);
break;
}
}
}

Collections.sort(roles, DataverseRole.CMP_BY_NAME);
Expand Down

0 comments on commit 73d7216

Please sign in to comment.