Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAK-49876 SiteManage tool order certain permissions can never be granted to students #12587

Merged
merged 1 commit into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading