Skip to content

Commit f74a497

Browse files
authored
SAK-48981 msgcntr handle forum and topic permission levels when using Lesson's prerequisites (#14604)
1 parent da99662 commit f74a497

18 files changed

Lines changed: 738 additions & 1027 deletions

File tree

config/configuration/bundles/src/bundle/org/sakaiproject/config/bundle/default.sakai.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3963,6 +3963,11 @@
39633963
# DEFAULT: false
39643964
# mc.disableLongDesc=true
39653965

3966+
# Messages tool option for sending a copy of a message to recipient email addresses.
3967+
# Options are 0 (Never), 1 (Optional), and 2 (Always)
3968+
# DEFAULT: 1
3969+
# msgcntr.defaultSendToEmailSetting=2
3970+
39663971
# Include a copy of the message to the recipient by default. Works in conjunction with user preference.
39673972
# DEFAULT: false
39683973
# mc.messages.ccEmailDefault=true

lessonbuilder/tool/src/java/org/sakaiproject/lessonbuildertool/service/ForumEntity.java

Lines changed: 26 additions & 311 deletions
Large diffs are not rendered by default.

msgcntr/messageforums-api/src/java/org/sakaiproject/api/app/messageforums/Area.java

Lines changed: 54 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -30,137 +30,129 @@ public interface Area extends MutableEntity {
3030
* setting for {@link #sendToEmail}. A copy of message is never sent
3131
* to recipients' email addresses
3232
*/
33-
public static final int EMAIL_COPY_NEVER = 0;
33+
int EMAIL_COPY_NEVER = 0;
3434
/**
3535
* setting for {@link #sendToEmail}. Sender is given the option of sending
3636
* a copy of message to email addresses
3737
*/
38-
public static final int EMAIL_COPY_OPTIONAL = 1;
38+
int EMAIL_COPY_OPTIONAL = 1;
3939
/**
4040
* setting for {@link #sendToEmail}. A copy of message is always sent
4141
* to recipients' email addresses
4242
*/
43-
public static final int EMAIL_COPY_ALWAYS = 2;
43+
int EMAIL_COPY_ALWAYS = 2;
4444

45-
public void setVersion(Integer version);
45+
void setVersion(Integer version);
4646

47-
public String getContextId();
47+
String getContextId();
4848

49-
public void setContextId(String contextId);
49+
void setContextId(String contextId);
5050

51-
public Boolean getHidden();
51+
Boolean getHidden();
5252

53-
public void setHidden(Boolean hidden);
53+
void setHidden(Boolean hidden);
5454

55-
public String getName();
55+
String getName();
5656

57-
public void setName(String name);
57+
void setName(String name);
5858

59-
public Boolean getEnabled();
59+
Boolean getEnabled();
6060

61-
public void setEnabled(Boolean enabled);
61+
void setEnabled(Boolean enabled);
6262

63-
/**
64-
* {@link Deprecated} This option was replaced by sendToEmail via MSGCNTR-708. DO NOT USE.
65-
* @return
66-
*/
67-
public Boolean getSendEmailOut();
63+
Boolean getSendEmailOut();
6864

69-
/**
70-
* {@link Deprecated} This option was replaced by sendToEmail via MSGCNTR-708. DO NOT USE.
71-
* @param sendEmailOut
72-
*/
73-
public void setSendEmailOut(Boolean sendEmailOut);
65+
void setSendEmailOut(Boolean sendEmailOut);
7466

7567
/**
7668
*
7769
* @return the site-level setting for sending a copy of the message to recipients'
7870
* email addresses. This may be {@link #EMAIL_COPY_NEVER}, #{@link #EMAIL_COPY_OPTIONAL},
7971
* {@link #EMAIL_COPY_ALWAYS}
8072
*/
81-
public int getSendToEmail();
73+
int getSendToEmail();
8274

8375
/**
8476
* set the site-level setting for sending a copy of the message to recipients'
8577
* email addresses. This may be {@link #EMAIL_COPY_NEVER}, #{@link #EMAIL_COPY_OPTIONAL},
8678
* {@link #EMAIL_COPY_ALWAYS}
8779
* @param sendToEmail
8880
*/
89-
public void setSendToEmail(int sendToEmail);
81+
void setSendToEmail(int sendToEmail);
9082

91-
public List getOpenForums();
83+
List<OpenForum> getOpenForums();
9284

93-
public Set getOpenForumsSet();
85+
Set<OpenForum> getOpenForumsSet();
9486

95-
public void setOpenForums(List openForums);
87+
void setOpenForums(List<OpenForum> openForums);
9688

97-
public List getPrivateForums();
89+
List<PrivateForum> getPrivateForums();
9890

99-
public Set getPrivateForumsSet();
91+
Set<PrivateForum> getPrivateForumsSet();
10092

101-
public void setPrivateForums(List discussionForums);
93+
void setPrivateForums(List<PrivateForum> discussionForums);
10294

103-
public List getDiscussionForums();
95+
List<DiscussionForum> getDiscussionForums();
10496

105-
public void setDiscussionForums(List discussionForums);
97+
void setDiscussionForums(List<DiscussionForum> discussionForums);
10698

107-
public String getTypeUuid();
99+
String getTypeUuid();
108100

109-
public void setTypeUuid(String typeUuid);
101+
void setTypeUuid(String typeUuid);
110102

111-
public void addPrivateForum(BaseForum forum);
103+
void addPrivateForum(PrivateForum forum);
112104

113-
public void removePrivateForum(BaseForum forum);
105+
void removePrivateForum(PrivateForum forum);
114106

115-
public void addDiscussionForum(BaseForum forum);
107+
void addDiscussionForum(DiscussionForum forum);
116108

117-
public void removeDiscussionForum(BaseForum forum);
109+
void removeDiscussionForum(DiscussionForum forum);
118110

119-
public void addOpenForum(BaseForum forum);
111+
void addOpenForum(OpenForum forum);
120112

121-
public void removeOpenForum(BaseForum forum);
113+
void removeOpenForum(OpenForum forum);
122114

123-
public Boolean getLocked();
115+
Boolean getLocked();
124116

125-
public void setLocked(Boolean locked);
117+
void setLocked(Boolean locked);
126118

127-
public Boolean getModerated();
119+
Boolean getModerated();
128120

129-
public void setModerated(Boolean moderated);
121+
void setModerated(Boolean moderated);
130122

131-
public Boolean getAutoMarkThreadsRead();
123+
Boolean getAutoMarkThreadsRead();
132124

133-
public void setAutoMarkThreadsRead(Boolean autoMarkThreadsRead);
125+
void setAutoMarkThreadsRead(Boolean autoMarkThreadsRead);
134126

135-
public Set<DBMembershipItem> getMembershipItemSet();
127+
Set<DBMembershipItem> getMembershipItemSet();
136128

137-
public void setMembershipItemSet(Set<DBMembershipItem> membershipItemSet);
129+
void setMembershipItemSet(Set<DBMembershipItem> membershipItemSet);
138130

139-
public void addMembershipItem(DBMembershipItem item);
131+
void addMembershipItem(DBMembershipItem item);
140132

141-
public void removeMembershipItem(DBMembershipItem item);
133+
void removeMembershipItem(DBMembershipItem item);
142134

143-
public Boolean getAvailabilityRestricted();
135+
Boolean getAvailabilityRestricted();
144136

145-
public void setAvailabilityRestricted(Boolean restricted);
137+
void setAvailabilityRestricted(Boolean restricted);
146138

147-
public Date getOpenDate();
139+
Date getOpenDate();
148140

149-
public void setOpenDate(Date openDate);
141+
void setOpenDate(Date openDate);
150142

151-
public Date getCloseDate();
143+
Date getCloseDate();
152144

153-
public void setCloseDate(Date closeDate);
145+
void setCloseDate(Date closeDate);
154146

155-
public Boolean getAvailability();
147+
Boolean getAvailability();
156148

157-
public void setAvailability(Boolean restricted);
149+
void setAvailability(Boolean restricted);
158150

159-
public Boolean getPostFirst();
151+
Boolean getPostFirst();
160152

161-
public void setPostFirst(Boolean postFirst);
153+
void setPostFirst(Boolean postFirst);
162154

163-
public Set getHiddenGroups();
155+
Set<HiddenGroup> getHiddenGroups();
164156

165-
public void setHiddenGroups(Set hiddenGroups);
157+
void setHiddenGroups(Set<HiddenGroup> hiddenGroups);
166158
}

msgcntr/messageforums-api/src/java/org/sakaiproject/api/app/messageforums/MessageForumsForumManager.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,20 @@ public interface MessageForumsForumManager {
284284
public List getForumByTypeAndContextWithTopicsAllAttachments(final String typeUuid, final String contextId);
285285

286286
/**
287-
*
287+
*
288288
* @param topicId
289289
* @return the Topic with the given id with the DBMembershipItems initialized.
290290
* Does not initialize attachments or messages.
291291
*/
292292
public Topic getTopicByIdWithMemberships(final Long topicId);
293293

294+
/**
295+
* @param forumId
296+
* @return the BaseForum with the given id with the DBMembershipItems initialized.
297+
* Does not initialize attachments or topics.
298+
*/
299+
public BaseForum getForumByIdWithMemberships(final Long forumId);
300+
294301
/**
295302
* @param contextId the context in which we are seeking topics
296303
* @return all topics within this context

msgcntr/messageforums-api/src/java/org/sakaiproject/api/app/messageforums/ui/DiscussionForumManager.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,4 +676,28 @@ public void saveTopicMessagePermissions(DiscussionTopic topic,
676676
public Optional<LRS_Statement> getStatementForGrade(String studentUid, String forumTitle, double score);
677677

678678
void setUiPermissionsManager(UIPermissionsManager uiPermissionsManager);
679+
680+
/**
681+
* Restrict access to a topic to the named groups only.
682+
* Contributor-level role and group items are set to None; items for the specified groups are set
683+
* to Contributor. Owner items are never modified. Passing null or an empty set are treated
684+
* identically and restore role items to Contributor and group items to None (open to site).
685+
* If the site or any group ID cannot be resolved, the operation is aborted and no changes are saved.
686+
*
687+
* @param topicId the id of the DiscussionTopic
688+
* @param groupIds site group IDs; null or empty means "open to site"
689+
*/
690+
void setTopicGroupRestrictions(Long topicId, Set<String> groupIds);
691+
692+
/**
693+
* Restrict access to a forum to the named groups only.
694+
* Contributor-level role and group items are set to None; items for the specified groups are set
695+
* to Contributor. Owner items are never modified. Passing null or an empty set are treated
696+
* identically and restore role items to Contributor and group items to None (open to site).
697+
* If the site or any group ID cannot be resolved, the operation is aborted and no changes are saved.
698+
*
699+
* @param forumId the id of the DiscussionForum
700+
* @param groupIds site group IDs; null or empty means "open to site"
701+
*/
702+
void setForumGroupRestrictions(Long forumId, Set<String> groupIds);
679703
}

0 commit comments

Comments
 (0)