Skip to content

Commit

Permalink
Merge pull request #23 from scolapasta/patch-1
Browse files Browse the repository at this point in the history
Update ManagePermissionsPage.java
  • Loading branch information
haarli authored Feb 14, 2022
2 parents 4a03b49 + 9b818cf commit 119e841
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,16 @@ public List<DataverseRole> getAvailableRoles() {
}

} else if (dvObject instanceof DataFile) {
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 119e841

Please sign in to comment.