Skip to content

Commit

Permalink
SAK-49876 SiteManage tool order certain permissions can never be gran…
Browse files Browse the repository at this point in the history
…ted to students (#12587)
  • Loading branch information
ottenhoff authored May 10, 2024
1 parent cc4ed7d commit 74c1214
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 74c1214

Please sign in to comment.