Skip to content

Commit

Permalink
SAK-49876 ToolOrder: certain permissions can never be granted to Stud…
Browse files Browse the repository at this point in the history
…ents.

This currently includes site.visit, site.upd, and rubrics.manager.view
  • Loading branch information
ottenhoff committed May 10, 2024
1 parent 5e6f679 commit 1f5cca7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ public class SitePageEditHandler {
private Set<String> defaultMultiTools
= new HashSet(Arrays.asList(new String [] {"sakai.news", "sakai.iframe"}));

// List of tool permissions that we can never grant to students
List<String> instructorPermissionsOnly = Arrays.asList(SiteService.SECURE_UPDATE_SITE, SiteService.SITE_VISIT, "rubrics.manager.view");

/**
* Gets the current tool
* @return Tool
Expand Down Expand Up @@ -465,7 +468,7 @@ public boolean allowDisable(SitePage page) {
return false;
}
List<String> permissions = getSingleToolPagePermissions(page).stream().flatMap(Collection::stream).collect(Collectors.toList());
return !(permissions.isEmpty() || permissions.contains(SiteService.SECURE_UPDATE_SITE) || permissions.contains(SiteService.SITE_VISIT));
return !(permissions.isEmpty() || instructorPermissionsOnly.stream().anyMatch(permissions::contains));
}

/**
Expand Down

0 comments on commit 1f5cca7

Please sign in to comment.