001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/msgcntr/trunk/messageforums-api/src/java/org/sakaiproject/api/app/messageforums/PermissionManager.java $
003: * $Id: PermissionManager.java 9227 2006-05-15 15:02:42Z cwen@iupui.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.api.app.messageforums;
021:
022: public interface PermissionManager {
023:
024: /**
025: * Get the area control permission for a given role. This provides the permissions
026: * that the role currently has.
027: */
028: public AreaControlPermission getAreaControlPermissionForRole(
029: String role, String typeId);
030:
031: /**
032: * Get the default area control permission for a given role. This provides the
033: * permissions that the role currently has.
034: */
035: public AreaControlPermission getDefaultAreaControlPermissionForRole(
036: String role, String typeId);
037:
038: /**
039: * Create an empty area control permission with system properties
040: * populated (ie: uuid).
041: */
042: public AreaControlPermission createAreaControlPermissionForRole(
043: String role, String typeId);
044:
045: /**
046: * Save an area control permission. This is backed in the database by a single
047: * Control permission (used for areas, forums, and topics).
048: */
049: public void saveAreaControlPermissionForRole(Area area,
050: AreaControlPermission permission, String typeId);
051:
052: /**
053: * Save a default area control permission. This is backed in the database by a
054: * single Control permission (used for areas, forums, and topics).
055: */
056: public void saveDefaultAreaControlPermissionForRole(Area area,
057: AreaControlPermission permission, String typeId);
058:
059: /**
060: * Get the forum control permission for a given role. This provides the permissions
061: * that the role currently has.
062: */
063: public ForumControlPermission getForumControlPermissionForRole(
064: BaseForum forum, String role, String typeId);
065:
066: /**
067: * Get the default forum control permission for a given role. This provides the
068: * permissions that the role currently has.
069: */
070: public ForumControlPermission getDefaultForumControlPermissionForRole(
071: BaseForum forum, String role, String typeId);
072:
073: /**
074: * Create an empty forum control permission with system properties
075: * populated (ie: uuid).
076: */
077: public ForumControlPermission createForumControlPermissionForRole(
078: String role, String typeId);
079:
080: /**
081: * Save an forum control permission. This is backed in the database by a single
082: * Control permission (used for topics, forums, and topics).
083: */
084: public void saveForumControlPermissionForRole(BaseForum forum,
085: ForumControlPermission permission);
086:
087: /**
088: * Save a default forum control permission. This is backed in the database by a
089: * single Control permission (used for topics, forums, and topics).
090: */
091: public void saveDefaultForumControlPermissionForRole(
092: BaseForum forum, ForumControlPermission permission);
093:
094: /**
095: * Get the topic control permission for a given role. This provides the permissions
096: * that the role currently has.
097: */
098: public TopicControlPermission getTopicControlPermissionForRole(
099: Topic topic, String role, String typeId);
100:
101: /**
102: * Get the default topic control permission for a given role. This provides the
103: * permissions that the role currently has.
104: */
105: public TopicControlPermission getDefaultTopicControlPermissionForRole(
106: Topic topic, String role, String typeId);
107:
108: /**
109: * Create an empty topic control permission with system properties
110: * populated (ie: uuid).
111: */
112: public TopicControlPermission createTopicControlPermissionForRole(
113: BaseForum forum, String role, String typeId);
114:
115: /**
116: * Save an topic control permission. This is backed in the database by a single
117: * Control permission (used for areas, forums, and topics).
118: */
119: public void saveTopicControlPermissionForRole(Topic topic,
120: TopicControlPermission permission);
121:
122: /**
123: * Save a default topic control permission. This is backed in the database by a
124: * single Control permission (used for areas, forums, and topics).
125: */
126: public void saveDefaultTopicControlPermissionForRole(Topic topic,
127: TopicControlPermission permission);
128:
129: public ControlPermissions getAreaControlPermissionByRoleAndType(
130: String roleId, String typeId, boolean defaultValue);
131:
132: /**
133: * Get the area message permission for a given role. This provides the permissions
134: * that the role currently has.
135: */
136: public MessagePermissions getAreaMessagePermissionForRole(
137: String role, String typeId);
138:
139: /**
140: * Get the default area message permission for a given role. This provides the
141: * permissions that the role currently has.
142: */
143: public MessagePermissions getDefaultAreaMessagePermissionForRole(
144: String role, String typeId);
145:
146: /**
147: * Create an empty area message permission with system properties
148: * populated (ie: uuid).
149: */
150: public MessagePermissions createAreaMessagePermissionForRole(
151: String role, String typeId);
152:
153: /**
154: * Save an area message permission. This is backed in the database by a single
155: * message permission (used for areas, forums, and topics).
156: */
157: public void saveAreaMessagePermissionForRole(Area area,
158: MessagePermissions permission, String typeId);
159:
160: /**
161: * Save a default area message permission. This is backed in the database by a
162: * single message permission (used for areas, forums, and topics).
163: */
164: public void saveDefaultAreaMessagePermissionForRole(Area area,
165: MessagePermissions permission, String typeId);
166:
167: /**
168: * Get the forum message permission for a given role. This provides the permissions
169: * that the role currently has.
170: */
171: public MessagePermissions getForumMessagePermissionForRole(
172: BaseForum forum, String role, String typeId);
173:
174: /**
175: * Get the default forum message permission for a given role. This provides the
176: * permissions that the role currently has.
177: */
178: public MessagePermissions getDefaultForumMessagePermissionForRole(
179: BaseForum forum, String role, String typeId);
180:
181: /**
182: * Create an empty forum message permission with system properties
183: * populated (ie: uuid).
184: */
185: public MessagePermissions createForumMessagePermissionForRole(
186: String role, String typeId);
187:
188: /**
189: * Save an forum message permission. This is backed in the database by a single
190: * message permission (used for topics, forums, and topics).
191: */
192: public void saveForumMessagePermissionForRole(BaseForum forum,
193: MessagePermissions permission);
194:
195: /**
196: * Save a default forum message permission. This is backed in the database by a
197: * single message permission (used for topics, forums, and topics).
198: */
199: public void saveDefaultForumMessagePermissionForRole(
200: BaseForum forum, MessagePermissions permission);
201:
202: /**
203: * Get the topic message permission for a given role. This provides the permissions
204: * that the role currently has.
205: */
206: public MessagePermissions getTopicMessagePermissionForRole(
207: Topic topic, String role, String typeId);
208:
209: /**
210: * Get the default topic message permission for a given role. This provides the
211: * permissions that the role currently has.
212: */
213: public MessagePermissions getDefaultTopicMessagePermissionForRole(
214: Topic topic, String role, String typeId);
215:
216: /**
217: * Create an empty topic message permission with system properties
218: * populated (ie: uuid).
219: */
220: public MessagePermissions createTopicMessagePermissionForRole(
221: BaseForum forum, String role, String typeId);
222:
223: /**
224: * Save an topic message permission. This is backed in the database by a single
225: * message permission (used for areas, forums, and topics).
226: */
227: public void saveTopicMessagePermissionForRole(Topic topic,
228: MessagePermissions permission);
229:
230: /**
231: * Save a default topic message permission. This is backed in the database by a
232: * single message permission (used for areas, forums, and topics).
233: */
234: public void saveDefaultTopicMessagePermissionForRole(Topic topic,
235: MessagePermissions permission);
236:
237: public MessagePermissions getAreaMessagePermissionByRoleAndType(
238: String roleId, String typeId, boolean defaultValue);
239:
240: }
|