Skip to content

Commit

Permalink
SAK-44132 Add Sakai property to disable group permission locking in F…
Browse files Browse the repository at this point in the history
  • Loading branch information
ansorgej authored Nov 3, 2020
1 parent 5cf39a3 commit efc5f79
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4144,6 +4144,10 @@
# DEFAULT: access,Student
# msgcntr.rolesnone=

# SAK-44132 groups permissions can be locked or made uneditable so that group-scoped topics can't be manipulated
# DEFAULT: false (off)
# msgcntr.restricted.group.perms=true

## SAK-19178
# Should we load the initial jobs on startup.
# - "init" will schedule the jobs *only* on the first startup of Sakai.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,7 @@ private String saveTopicSettings(boolean draft)
}

topic.setBaseForum(selectedForum.getForum());
if(selectedForum.getForum().getRestrictPermissionsForGroups()){
if(selectedForum.getForum().getRestrictPermissionsForGroups() && ServerConfigurationService.getBoolean("msgcntr.restricted.group.perms", false)){
topic.setRestrictPermissionsForGroups(true);
}
if(topic.getCreatedBy()==null&&this.forumManager.getAnonRole()==true){
Expand Down Expand Up @@ -8024,7 +8024,9 @@ private boolean saveForumsForGroups(boolean draft) {
if (currentGroup.getCreateForumForGroup()==true) {
groupSelected = true;
DiscussionForum forum = forumManager.createForum();
forum.setRestrictPermissionsForGroups(forumTemplate.getForum().getRestrictPermissionsForGroups());
if (ServerConfigurationService.getBoolean("msgcntr.restricted.group.perms", false)) {
forum.setRestrictPermissionsForGroups(forumTemplate.getForum().getRestrictPermissionsForGroups());
}
forum.setModerated(forumTemplate.getForum().getModerated());
forum.setAutoMarkThreadsRead(forumTemplate.getForum().getAutoMarkThreadsRead());
forum.setPostFirst(forumTemplate.getForum().getPostFirst());
Expand Down Expand Up @@ -8112,7 +8114,9 @@ private boolean saveTopicsForGroups(boolean draft) {
selectedTopic = createTopic(topicTempate.getTopic().getBaseForum().getId());
selectedTopic.setGradeAssign(topicTempate.getGradeAssign());
DiscussionTopic thisTopic = selectedTopic.getTopic();
thisTopic.setRestrictPermissionsForGroups(topicTempate.getTopic().getRestrictPermissionsForGroups());
if (ServerConfigurationService.getBoolean("msgcntr.restricted.group.perms", false)) {
thisTopic.setRestrictPermissionsForGroups(topicTempate.getTopic().getRestrictPermissionsForGroups());
}
thisTopic.setTitle(topicTempate.getTopic().getTitle() + " - " + currentGroup.getGroup().getTitle());
thisTopic.setShortDescription(topicTempate.getTopic().getShortDescription());
thisTopic.setExtendedDescription(topicTempate.getTopic().getExtendedDescription());
Expand Down

0 comments on commit efc5f79

Please sign in to comment.