From 74c12148cd3ba3b3eb37f4bd0185d303127705d7 Mon Sep 17 00:00:00 2001 From: Sam Ottenhoff Date: Fri, 10 May 2024 17:46:42 -0400 Subject: [PATCH] SAK-49876 SiteManage tool order certain permissions can never be granted to students (#12587) --- .../site/tool/helper/order/impl/SitePageEditHandler.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/site-manage/pageorder/tool/src/java/org/sakaiproject/site/tool/helper/order/impl/SitePageEditHandler.java b/site-manage/pageorder/tool/src/java/org/sakaiproject/site/tool/helper/order/impl/SitePageEditHandler.java index a271ec9eada0..ea7f7496639d 100644 --- a/site-manage/pageorder/tool/src/java/org/sakaiproject/site/tool/helper/order/impl/SitePageEditHandler.java +++ b/site-manage/pageorder/tool/src/java/org/sakaiproject/site/tool/helper/order/impl/SitePageEditHandler.java @@ -120,6 +120,9 @@ public class SitePageEditHandler { private Set defaultMultiTools = new HashSet(Arrays.asList(new String [] {"sakai.news", "sakai.iframe"})); + // List of tool permissions that we can never grant to students + List instructorPermissionsOnly = Arrays.asList(SiteService.SECURE_UPDATE_SITE, SiteService.SITE_VISIT, "rubrics.manager.view"); + /** * Gets the current tool * @return Tool @@ -465,7 +468,7 @@ public boolean allowDisable(SitePage page) { return false; } List 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)); } /**