1 | |
package org.kuali.student.enrollment.class2.courseoffering.service.decorators; |
2 | |
|
3 | |
import java.util.List; |
4 | |
|
5 | |
import org.kuali.rice.core.api.criteria.QueryByCriteria; |
6 | |
|
7 | |
import org.kuali.rice.kim.api.permission.PermissionService; |
8 | |
import org.kuali.student.enrollment.courseoffering.dto.*; |
9 | |
import org.kuali.student.enrollment.courseregistration.dto.CourseRegistrationInfo; |
10 | |
import org.kuali.student.r2.common.dto.ContextInfo; |
11 | |
import org.kuali.student.r2.common.dto.StatusInfo; |
12 | |
import org.kuali.student.r2.common.dto.ValidationResultInfo; |
13 | |
import org.kuali.student.r2.common.exceptions.*; |
14 | |
import org.kuali.student.r2.common.infc.HoldsPermissionService; |
15 | |
import org.kuali.student.r2.core.type.dto.TypeInfo; |
16 | |
|
17 | 0 | public class CourseOfferingServiceAuthorizationDecorator extends CourseOfferingServiceDecorator implements HoldsPermissionService{ |
18 | |
public static final String ENRLLMENT_NAMESPACE = "KS-ENROLL"; |
19 | |
public static final String SERVICE_NAME = "CourseOfferingService."; |
20 | |
|
21 | |
private PermissionService permissionService; |
22 | |
|
23 | |
@Override |
24 | |
public PermissionService getPermissionService() { |
25 | 0 | return permissionService; |
26 | |
} |
27 | |
|
28 | |
@Override |
29 | |
public void setPermissionService(PermissionService permissionService) { |
30 | 0 | this.permissionService = permissionService; |
31 | 0 | } |
32 | |
|
33 | |
@Override |
34 | |
public CourseOfferingInfo getCourseOffering(String courseOfferingId, |
35 | |
ContextInfo context) throws DoesNotExistException, |
36 | |
InvalidParameterException, MissingParameterException, |
37 | |
OperationFailedException, PermissionDeniedException { |
38 | 0 | if (null == context) { |
39 | 0 | throw new MissingParameterException(); |
40 | |
} |
41 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getCourseOffering", null)) { |
42 | 0 | return getNextDecorator().getCourseOffering(courseOfferingId, context); |
43 | |
} |
44 | |
else { |
45 | 0 | throw new PermissionDeniedException(); |
46 | |
} |
47 | |
} |
48 | |
|
49 | |
@Override |
50 | |
public List<CourseOfferingInfo> getCourseOfferingsByIds( |
51 | |
List<String> courseOfferingIds, ContextInfo context) |
52 | |
throws DoesNotExistException, InvalidParameterException, |
53 | |
MissingParameterException, OperationFailedException, |
54 | |
PermissionDeniedException { |
55 | 0 | if (null == context) { |
56 | 0 | throw new MissingParameterException(); |
57 | |
} |
58 | |
|
59 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getCourseOfferingsByIds", null)) { |
60 | 0 | return getNextDecorator().getCourseOfferingsByIds(courseOfferingIds, context); |
61 | |
} |
62 | |
else { |
63 | 0 | throw new PermissionDeniedException(); |
64 | |
} |
65 | |
} |
66 | |
|
67 | |
@Override |
68 | |
public List<CourseOfferingInfo> getCourseOfferingsByCourseAndTerm( |
69 | |
String courseId, String termId, ContextInfo context) |
70 | |
throws DoesNotExistException, InvalidParameterException, |
71 | |
MissingParameterException, OperationFailedException, |
72 | |
PermissionDeniedException { |
73 | 0 | if (null == context) { |
74 | 0 | throw new MissingParameterException(); |
75 | |
} |
76 | |
|
77 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getCourseOfferingsByCourseAndTerm", null)) { |
78 | 0 | return getNextDecorator().getCourseOfferingsByCourseAndTerm(courseId, termId, context); |
79 | |
} |
80 | |
else { |
81 | 0 | throw new PermissionDeniedException(); |
82 | |
} |
83 | |
} |
84 | |
|
85 | |
@Override |
86 | |
public List<String> getCourseOfferingIdsByTerm(String termId, |
87 | |
Boolean useIncludedTerm, ContextInfo context) |
88 | |
throws DoesNotExistException, InvalidParameterException, |
89 | |
MissingParameterException, OperationFailedException, |
90 | |
PermissionDeniedException { |
91 | 0 | if (null == context) { |
92 | 0 | throw new MissingParameterException(); |
93 | |
} |
94 | |
|
95 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getCourseOfferingIdsByTerm", null)) { |
96 | 0 | return getNextDecorator().getCourseOfferingIdsByTerm(termId, useIncludedTerm, context); |
97 | |
} |
98 | |
else { |
99 | 0 | throw new PermissionDeniedException(); |
100 | |
} |
101 | |
} |
102 | |
|
103 | |
@Override |
104 | |
public List<String> getCourseOfferingIdsByTermAndSubjectArea( |
105 | |
String termId, String subjectArea, ContextInfo context) |
106 | |
throws DoesNotExistException, InvalidParameterException, |
107 | |
MissingParameterException, OperationFailedException, |
108 | |
PermissionDeniedException { |
109 | 0 | if (null == context) { |
110 | 0 | throw new MissingParameterException(); |
111 | |
} |
112 | |
|
113 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getCourseOfferingIdsByTermAndSubjectArea", null)) { |
114 | 0 | return getNextDecorator().getCourseOfferingIdsByTermAndSubjectArea(termId, subjectArea, context); |
115 | |
} |
116 | |
else { |
117 | 0 | throw new PermissionDeniedException(); |
118 | |
} |
119 | |
} |
120 | |
|
121 | |
@Override |
122 | |
public List<CourseOfferingInfo> getCourseOfferingsByTermAndInstructor( |
123 | |
String termId, String instructorId, ContextInfo context) |
124 | |
throws DoesNotExistException, InvalidParameterException, |
125 | |
MissingParameterException, OperationFailedException, |
126 | |
PermissionDeniedException { |
127 | 0 | if (null == context) { |
128 | 0 | throw new MissingParameterException(); |
129 | |
} |
130 | |
|
131 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getCourseOfferingsByTermAndInstructor", null)) { |
132 | 0 | return getNextDecorator().getCourseOfferingsByTermAndInstructor(termId, instructorId, context); |
133 | |
} |
134 | |
else { |
135 | 0 | throw new PermissionDeniedException(); |
136 | |
} |
137 | |
} |
138 | |
|
139 | |
@Override |
140 | |
public List<String> getCourseOfferingIdsByTermAndUnitsContentOwner( |
141 | |
String termId, String unitsContentOwnerId, ContextInfo context) |
142 | |
throws DoesNotExistException, InvalidParameterException, |
143 | |
MissingParameterException, OperationFailedException, |
144 | |
PermissionDeniedException { |
145 | 0 | if (null == context) { |
146 | 0 | throw new MissingParameterException(); |
147 | |
} |
148 | |
|
149 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getCourseOfferingIdsByTermAndUnitContentOwner", null)) { |
150 | 0 | return getNextDecorator().getCourseOfferingIdsByTermAndUnitsContentOwner(termId, unitsContentOwnerId, context); |
151 | |
} |
152 | |
else { |
153 | 0 | throw new PermissionDeniedException(); |
154 | |
} |
155 | |
} |
156 | |
|
157 | |
@Override |
158 | |
public CourseOfferingInfo createCourseOffering(String courseId, |
159 | |
String termId, |
160 | |
String courseOfferingTypeKey, |
161 | |
CourseOfferingInfo courseOfferingInfo, |
162 | |
List<String> optionKeys, |
163 | |
ContextInfo context) |
164 | |
throws DoesNotExistException, DataValidationErrorException, |
165 | |
InvalidParameterException, MissingParameterException, |
166 | |
OperationFailedException, PermissionDeniedException, |
167 | |
ReadOnlyException { |
168 | |
|
169 | 0 | if (null == context) { |
170 | 0 | throw new MissingParameterException(); |
171 | |
} |
172 | |
|
173 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "createCourseOffering", null)) { |
174 | 0 | return getNextDecorator().createCourseOffering(courseId, termId, courseOfferingTypeKey, courseOfferingInfo, optionKeys, context); |
175 | |
} |
176 | |
else { |
177 | 0 | throw new PermissionDeniedException(); |
178 | |
} |
179 | |
} |
180 | |
|
181 | |
@Override |
182 | |
public CourseOfferingInfo updateCourseOffering(String courseOfferingId, |
183 | |
CourseOfferingInfo courseOfferingInfo, ContextInfo context) |
184 | |
throws DataValidationErrorException, DoesNotExistException, |
185 | |
InvalidParameterException, MissingParameterException, |
186 | |
OperationFailedException, PermissionDeniedException, |
187 | |
ReadOnlyException, VersionMismatchException { |
188 | 0 | if (null == context) { |
189 | 0 | throw new MissingParameterException(); |
190 | |
} |
191 | |
|
192 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "updateCourseOffering", null)) { |
193 | 0 | return getNextDecorator().updateCourseOffering(courseOfferingId, courseOfferingInfo, context); |
194 | |
} |
195 | |
else { |
196 | 0 | throw new PermissionDeniedException(); |
197 | |
} |
198 | |
} |
199 | |
|
200 | |
@Override |
201 | |
public CourseOfferingInfo updateCourseOfferingFromCanonical( |
202 | |
String courseOfferingId, |
203 | |
List<String> optionKeys, ContextInfo context) |
204 | |
throws DataValidationErrorException, DoesNotExistException, |
205 | |
InvalidParameterException, MissingParameterException, |
206 | |
OperationFailedException, PermissionDeniedException, |
207 | |
VersionMismatchException { |
208 | 0 | if (null == context) { |
209 | 0 | throw new MissingParameterException(); |
210 | |
} |
211 | |
|
212 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "updateCourseOfferingFromCanonical", null)) { |
213 | 0 | return getNextDecorator().updateCourseOfferingFromCanonical(courseOfferingId, optionKeys, context); |
214 | |
} |
215 | |
else { |
216 | 0 | throw new PermissionDeniedException(); |
217 | |
} |
218 | |
} |
219 | |
|
220 | |
@Override |
221 | |
public StatusInfo deleteCourseOffering(String courseOfferingId, |
222 | |
ContextInfo context) throws DoesNotExistException, |
223 | |
InvalidParameterException, MissingParameterException, |
224 | |
OperationFailedException, PermissionDeniedException, DependentObjectsExistException { |
225 | 0 | if (null == context) { |
226 | 0 | throw new MissingParameterException(); |
227 | |
} |
228 | |
|
229 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "deleteCourseOffering", null)) { |
230 | 0 | return getNextDecorator().deleteCourseOffering(courseOfferingId, context); |
231 | |
} |
232 | |
else { |
233 | 0 | throw new PermissionDeniedException(); |
234 | |
} |
235 | |
} |
236 | |
|
237 | |
@Override |
238 | |
public List<ValidationResultInfo> validateCourseOffering( |
239 | |
String validationType, CourseOfferingInfo courseOfferingInfo, |
240 | |
ContextInfo context) throws DoesNotExistException, |
241 | |
InvalidParameterException, MissingParameterException, |
242 | |
OperationFailedException { |
243 | 0 | if (null == context) { |
244 | 0 | throw new MissingParameterException(); |
245 | |
} |
246 | |
|
247 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "validateCourseOffering", null)) { |
248 | 0 | return getNextDecorator().validateCourseOffering(validationType, courseOfferingInfo, context); |
249 | |
} |
250 | |
else { |
251 | 0 | throw new OperationFailedException ("Permission Denied"); |
252 | |
} |
253 | |
} |
254 | |
|
255 | |
|
256 | |
@Override |
257 | |
public TypeInfo getActivityOfferingType(String activityOfferingTypeKey, |
258 | |
ContextInfo context) throws DoesNotExistException, |
259 | |
InvalidParameterException, MissingParameterException, |
260 | |
OperationFailedException, PermissionDeniedException { |
261 | 0 | if (null == context) { |
262 | 0 | throw new MissingParameterException(); |
263 | |
} |
264 | |
|
265 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getActivityOfferingType", null)) { |
266 | 0 | return getNextDecorator().getActivityOfferingType(activityOfferingTypeKey, context); |
267 | |
} |
268 | |
else { |
269 | 0 | throw new PermissionDeniedException (); |
270 | |
} |
271 | |
} |
272 | |
|
273 | |
@Override |
274 | |
public ActivityOfferingInfo getActivityOffering(String activityOfferingId, |
275 | |
ContextInfo context) throws DoesNotExistException, |
276 | |
InvalidParameterException, MissingParameterException, |
277 | |
OperationFailedException, PermissionDeniedException { |
278 | 0 | if (null == context) { |
279 | 0 | throw new MissingParameterException(); |
280 | |
} |
281 | |
|
282 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getActivityOffering", null)) { |
283 | 0 | return getNextDecorator().getActivityOffering(activityOfferingId, context); |
284 | |
} |
285 | |
else { |
286 | 0 | throw new PermissionDeniedException(); |
287 | |
} |
288 | |
} |
289 | |
|
290 | |
@Override |
291 | |
public List<ActivityOfferingInfo> getActivityOfferingsByIds( |
292 | |
List<String> activityOfferingIds, ContextInfo context) |
293 | |
throws DoesNotExistException, InvalidParameterException, |
294 | |
MissingParameterException, OperationFailedException, |
295 | |
PermissionDeniedException { |
296 | 0 | if (null == context) { |
297 | 0 | throw new MissingParameterException(); |
298 | |
} |
299 | |
|
300 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getActivityOfferingsByIds", null)) { |
301 | 0 | return getNextDecorator().getActivityOfferingsByIds(activityOfferingIds, context); |
302 | |
} |
303 | |
else { |
304 | 0 | throw new PermissionDeniedException(); |
305 | |
} |
306 | |
} |
307 | |
|
308 | |
@Override |
309 | |
public List<ActivityOfferingInfo> getActivityOfferingsByCourseOffering( |
310 | |
String courseOfferingId, ContextInfo context) |
311 | |
throws DoesNotExistException, InvalidParameterException, |
312 | |
MissingParameterException, OperationFailedException, |
313 | |
PermissionDeniedException { |
314 | 0 | if (null == context) { |
315 | 0 | throw new MissingParameterException(); |
316 | |
} |
317 | |
|
318 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getActivityOfferingsByCourseOffering", null)) { |
319 | 0 | return getNextDecorator().getActivityOfferingsByCourseOffering(courseOfferingId, context); |
320 | |
} |
321 | |
else { |
322 | 0 | throw new PermissionDeniedException(); |
323 | |
} |
324 | |
} |
325 | |
|
326 | |
@Override |
327 | |
public ActivityOfferingInfo createActivityOffering(String formatOfferingId, |
328 | |
String activityId, |
329 | |
String activityOfferingTypeKey, |
330 | |
ActivityOfferingInfo activityOfferingInfo, |
331 | |
ContextInfo context) |
332 | |
throws DoesNotExistException, DataValidationErrorException, |
333 | |
InvalidParameterException, MissingParameterException, |
334 | |
OperationFailedException, PermissionDeniedException, |
335 | |
ReadOnlyException { |
336 | 0 | if (null == context) { |
337 | 0 | throw new MissingParameterException(); |
338 | |
} |
339 | |
|
340 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "createActivityOffering", null)) { |
341 | 0 | return getNextDecorator().createActivityOffering(formatOfferingId, activityId, activityOfferingTypeKey, activityOfferingInfo, context); |
342 | |
} |
343 | |
else { |
344 | 0 | throw new PermissionDeniedException(); |
345 | |
} |
346 | |
} |
347 | |
|
348 | |
@Override |
349 | |
public ActivityOfferingInfo updateActivityOffering( |
350 | |
String activityOfferingId, |
351 | |
ActivityOfferingInfo activityOfferingInfo, ContextInfo context) |
352 | |
throws DataValidationErrorException, DoesNotExistException, |
353 | |
InvalidParameterException, MissingParameterException, |
354 | |
OperationFailedException, PermissionDeniedException, |
355 | |
ReadOnlyException, VersionMismatchException { |
356 | 0 | if (null == context) { |
357 | 0 | throw new MissingParameterException(); |
358 | |
} |
359 | |
|
360 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "updateActivityOffering", null)) { |
361 | 0 | return getNextDecorator().updateActivityOffering(activityOfferingId, activityOfferingInfo, context); |
362 | |
} |
363 | |
else { |
364 | 0 | throw new PermissionDeniedException(); |
365 | |
} |
366 | |
} |
367 | |
|
368 | |
@Override |
369 | |
public StatusInfo deleteActivityOffering(String activityOfferingId, |
370 | |
ContextInfo context) throws DoesNotExistException, |
371 | |
InvalidParameterException, MissingParameterException, |
372 | |
OperationFailedException, PermissionDeniedException, DependentObjectsExistException { |
373 | 0 | if (null == context) { |
374 | 0 | throw new MissingParameterException(); |
375 | |
} |
376 | |
|
377 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "deleteActivityOffering", null)) { |
378 | 0 | return getNextDecorator().deleteActivityOffering(activityOfferingId, context); |
379 | |
} |
380 | |
else { |
381 | 0 | throw new PermissionDeniedException(); |
382 | |
} |
383 | |
} |
384 | |
|
385 | |
@Override |
386 | |
public List<ValidationResultInfo> validateActivityOffering( |
387 | |
String validationType, ActivityOfferingInfo activityOfferingInfo, |
388 | |
ContextInfo context) throws DoesNotExistException, |
389 | |
InvalidParameterException, MissingParameterException, |
390 | |
OperationFailedException { |
391 | 0 | if (null == context) { |
392 | 0 | throw new MissingParameterException(); |
393 | |
} |
394 | |
|
395 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "validateActivityOffering", null)) { |
396 | 0 | return getNextDecorator().validateActivityOffering(validationType, activityOfferingInfo, context); |
397 | |
} |
398 | |
else { |
399 | 0 | throw new OperationFailedException ("Permission Denied"); |
400 | |
} |
401 | |
} |
402 | |
|
403 | |
@Override |
404 | |
public Float calculateInClassContactHoursForTerm(String activityOfferingId, |
405 | |
ContextInfo context) throws DoesNotExistException, |
406 | |
InvalidParameterException, MissingParameterException, |
407 | |
OperationFailedException, PermissionDeniedException { |
408 | 0 | if (null == context) { |
409 | 0 | throw new MissingParameterException(); |
410 | |
} |
411 | |
|
412 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "calculateInClassContactHoursForTerm", null)) { |
413 | 0 | return getNextDecorator().calculateInClassContactHoursForTerm(activityOfferingId, context); |
414 | |
} |
415 | |
else { |
416 | 0 | throw new PermissionDeniedException(); |
417 | |
} |
418 | |
} |
419 | |
|
420 | |
@Override |
421 | |
public Float calculateOutofClassContactHoursForTerm( |
422 | |
String activityOfferingId, ContextInfo context) |
423 | |
throws DoesNotExistException, InvalidParameterException, |
424 | |
MissingParameterException, OperationFailedException, |
425 | |
PermissionDeniedException { |
426 | 0 | if (null == context) { |
427 | 0 | throw new MissingParameterException(); |
428 | |
} |
429 | |
|
430 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "calculateOutofClassContactHoursForTerm", null)) { |
431 | 0 | return getNextDecorator().calculateOutofClassContactHoursForTerm(activityOfferingId, context); |
432 | |
} |
433 | |
else { |
434 | 0 | throw new PermissionDeniedException(); |
435 | |
} |
436 | |
} |
437 | |
|
438 | |
@Override |
439 | |
public Float calculateTotalContactHoursForTerm(String activityOfferingId, |
440 | |
ContextInfo context) throws DoesNotExistException, |
441 | |
InvalidParameterException, MissingParameterException, |
442 | |
OperationFailedException, PermissionDeniedException { |
443 | 0 | if (null == context) { |
444 | 0 | throw new MissingParameterException(); |
445 | |
} |
446 | |
|
447 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "calculateTotalContactHoursForTerm", null)) { |
448 | 0 | return getNextDecorator().calculateTotalContactHoursForTerm(activityOfferingId, context); |
449 | |
} |
450 | |
else { |
451 | 0 | throw new PermissionDeniedException(); |
452 | |
} |
453 | |
} |
454 | |
|
455 | |
|
456 | |
@Override |
457 | |
public RegistrationGroupInfo getRegistrationGroup( |
458 | |
String registrationGroupId, ContextInfo context) |
459 | |
throws DoesNotExistException, InvalidParameterException, |
460 | |
MissingParameterException, OperationFailedException, |
461 | |
PermissionDeniedException { |
462 | 0 | if (null == context) { |
463 | 0 | throw new MissingParameterException(); |
464 | |
} |
465 | |
|
466 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getRegistrationGroup", null)) { |
467 | 0 | return getNextDecorator().getRegistrationGroup(registrationGroupId, context); |
468 | |
} |
469 | |
else { |
470 | 0 | throw new PermissionDeniedException(); |
471 | |
} |
472 | |
} |
473 | |
|
474 | |
@Override |
475 | |
public List<RegistrationGroupInfo> getRegistrationGroupsByIds( |
476 | |
List<String> registrationGroupIds, ContextInfo context) |
477 | |
throws DoesNotExistException, InvalidParameterException, |
478 | |
MissingParameterException, OperationFailedException, |
479 | |
PermissionDeniedException { |
480 | 0 | if (null == context) { |
481 | 0 | throw new MissingParameterException(); |
482 | |
} |
483 | |
|
484 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getRegistrationGroupsByIds", null)) { |
485 | 0 | return getNextDecorator().getRegistrationGroupsByIds(registrationGroupIds, context); |
486 | |
} |
487 | |
else { |
488 | 0 | throw new PermissionDeniedException(); |
489 | |
} |
490 | |
} |
491 | |
|
492 | |
@Override |
493 | |
public List<RegistrationGroupInfo> getRegistrationGroupsForCourseOffering( |
494 | |
String courseOfferingId, ContextInfo context) |
495 | |
throws DoesNotExistException, InvalidParameterException, |
496 | |
MissingParameterException, OperationFailedException, |
497 | |
PermissionDeniedException { |
498 | 0 | if (null == context) { |
499 | 0 | throw new MissingParameterException(); |
500 | |
} |
501 | |
|
502 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getRegistrationGroupsForCourseOffering", null)) { |
503 | 0 | return getNextDecorator().getRegistrationGroupsForCourseOffering(courseOfferingId, context); |
504 | |
} |
505 | |
else { |
506 | 0 | throw new PermissionDeniedException(); |
507 | |
} |
508 | |
} |
509 | |
|
510 | |
|
511 | |
|
512 | |
|
513 | |
@Override |
514 | |
public RegistrationGroupInfo updateRegistrationGroup( |
515 | |
String registrationGroupId, |
516 | |
RegistrationGroupInfo registrationGroupInfo, ContextInfo context) |
517 | |
throws DataValidationErrorException, DoesNotExistException, |
518 | |
InvalidParameterException, MissingParameterException, |
519 | |
OperationFailedException, PermissionDeniedException, |
520 | |
ReadOnlyException, VersionMismatchException { |
521 | 0 | if (null == context) { |
522 | 0 | throw new MissingParameterException(); |
523 | |
} |
524 | |
|
525 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "updateRegistrationGroup", null)) { |
526 | 0 | return getNextDecorator().updateRegistrationGroup(registrationGroupId, registrationGroupInfo, context); |
527 | |
} |
528 | |
else { |
529 | 0 | throw new PermissionDeniedException(); |
530 | |
} |
531 | |
} |
532 | |
|
533 | |
@Override |
534 | |
public StatusInfo deleteRegistrationGroup(String registrationGroupId, |
535 | |
ContextInfo context) throws DoesNotExistException, |
536 | |
InvalidParameterException, MissingParameterException, |
537 | |
OperationFailedException, PermissionDeniedException { |
538 | 0 | if (null == context) { |
539 | 0 | throw new MissingParameterException(); |
540 | |
} |
541 | |
|
542 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "deleteRegistrationGroup", null)) { |
543 | 0 | return getNextDecorator().deleteRegistrationGroup(registrationGroupId, context); |
544 | |
} |
545 | |
else { |
546 | 0 | throw new PermissionDeniedException(); |
547 | |
} |
548 | |
} |
549 | |
|
550 | |
@Override |
551 | |
public List<ValidationResultInfo> validateRegistrationGroup( |
552 | |
String validationType, RegistrationGroupInfo registrationGroupInfo, |
553 | |
ContextInfo context) throws DoesNotExistException, |
554 | |
InvalidParameterException, MissingParameterException, |
555 | |
OperationFailedException { |
556 | 0 | if (null == context) { |
557 | 0 | throw new MissingParameterException(); |
558 | |
} |
559 | |
|
560 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "validateRegistrationGroup", null)) { |
561 | 0 | return getNextDecorator().validateRegistrationGroup(validationType, registrationGroupInfo, context); |
562 | |
} |
563 | |
else { |
564 | 0 | throw new OperationFailedException ("Permission Denied"); |
565 | |
} |
566 | |
} |
567 | |
|
568 | |
@Override |
569 | |
public SeatPoolDefinitionInfo getSeatPoolDefinition( |
570 | |
String seatPoolDefinitionId, ContextInfo context) |
571 | |
throws DoesNotExistException, InvalidParameterException, |
572 | |
MissingParameterException, OperationFailedException, |
573 | |
PermissionDeniedException { |
574 | 0 | if (null == context) { |
575 | 0 | throw new MissingParameterException(); |
576 | |
} |
577 | |
|
578 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getSeatPoolDefinition", null)) { |
579 | 0 | return getNextDecorator().getSeatPoolDefinition(seatPoolDefinitionId, context); |
580 | |
} |
581 | |
else { |
582 | 0 | throw new PermissionDeniedException(); |
583 | |
} |
584 | |
} |
585 | |
|
586 | |
|
587 | |
@Override |
588 | |
public SeatPoolDefinitionInfo createSeatPoolDefinition( |
589 | |
SeatPoolDefinitionInfo seatPoolDefinitionInfo, ContextInfo context) |
590 | |
throws DataValidationErrorException, |
591 | |
InvalidParameterException, MissingParameterException, |
592 | |
OperationFailedException, PermissionDeniedException, |
593 | |
ReadOnlyException { |
594 | 0 | if (null == context) { |
595 | 0 | throw new MissingParameterException(); |
596 | |
} |
597 | |
|
598 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "createSeatPoolDefinition", null)) { |
599 | 0 | return getNextDecorator().createSeatPoolDefinition(seatPoolDefinitionInfo, context); |
600 | |
} |
601 | |
else { |
602 | 0 | throw new PermissionDeniedException(); |
603 | |
} |
604 | |
} |
605 | |
|
606 | |
@Override |
607 | |
public SeatPoolDefinitionInfo updateSeatPoolDefinition( |
608 | |
String seatPoolDefinitionId, |
609 | |
SeatPoolDefinitionInfo seatPoolDefinitionInfo, ContextInfo context) |
610 | |
throws DataValidationErrorException, DoesNotExistException, |
611 | |
InvalidParameterException, MissingParameterException, |
612 | |
OperationFailedException, PermissionDeniedException, |
613 | |
ReadOnlyException, |
614 | |
VersionMismatchException { |
615 | 0 | if (null == context) { |
616 | 0 | throw new MissingParameterException(); |
617 | |
} |
618 | |
|
619 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "updateSeatPoolDefinition", null)) { |
620 | 0 | return getNextDecorator().updateSeatPoolDefinition(seatPoolDefinitionId, seatPoolDefinitionInfo, context); |
621 | |
} |
622 | |
else { |
623 | 0 | throw new PermissionDeniedException(); |
624 | |
} |
625 | |
} |
626 | |
|
627 | |
@Override |
628 | |
public StatusInfo deleteSeatPoolDefinition(String seatPoolDefinitionId, |
629 | |
ContextInfo context) throws DoesNotExistException, |
630 | |
InvalidParameterException, MissingParameterException, |
631 | |
OperationFailedException, PermissionDeniedException { |
632 | 0 | if (null == context) { |
633 | 0 | throw new MissingParameterException(); |
634 | |
} |
635 | |
|
636 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "deleteSeatPoolDefinition", null)) { |
637 | 0 | return getNextDecorator().deleteSeatPoolDefinition(seatPoolDefinitionId, context); |
638 | |
} |
639 | |
else { |
640 | 0 | throw new PermissionDeniedException(); |
641 | |
} |
642 | |
} |
643 | |
|
644 | |
@Override |
645 | |
public List<CourseOfferingInfo> searchForCourseOfferings( |
646 | |
QueryByCriteria criteria, ContextInfo context) |
647 | |
throws InvalidParameterException, MissingParameterException, |
648 | |
OperationFailedException, PermissionDeniedException { |
649 | 0 | if (null == context) { |
650 | 0 | throw new MissingParameterException(); |
651 | |
} |
652 | |
|
653 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "searchForCourseOfferings", null)) { |
654 | 0 | return getNextDecorator().searchForCourseOfferings(criteria, context); |
655 | |
} |
656 | |
else { |
657 | 0 | throw new PermissionDeniedException(); |
658 | |
} |
659 | |
} |
660 | |
|
661 | |
@Override |
662 | |
public List<String> searchForCourseOfferingIds(QueryByCriteria criteria, |
663 | |
ContextInfo context) throws InvalidParameterException, |
664 | |
MissingParameterException, OperationFailedException, |
665 | |
PermissionDeniedException { |
666 | 0 | if (null == context) { |
667 | 0 | throw new MissingParameterException(); |
668 | |
} |
669 | |
|
670 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "searchForCourseOfferingIds", null)) { |
671 | 0 | return getNextDecorator().searchForCourseOfferingIds(criteria, context); |
672 | |
} |
673 | |
else { |
674 | 0 | throw new PermissionDeniedException(); |
675 | |
} |
676 | |
} |
677 | |
|
678 | |
@Override |
679 | |
public List<ActivityOfferingInfo> searchForActivityOfferings( |
680 | |
QueryByCriteria criteria, ContextInfo context) |
681 | |
throws InvalidParameterException, MissingParameterException, |
682 | |
OperationFailedException, PermissionDeniedException { |
683 | 0 | if (null == context) { |
684 | 0 | throw new MissingParameterException(); |
685 | |
} |
686 | |
|
687 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "searchForActivityOfferings", null)) { |
688 | 0 | return getNextDecorator().searchForActivityOfferings(criteria, context); |
689 | |
} |
690 | |
else { |
691 | 0 | throw new PermissionDeniedException(); |
692 | |
} |
693 | |
} |
694 | |
|
695 | |
@Override |
696 | |
public List<String> searchForActivityOfferingIds(QueryByCriteria criteria, |
697 | |
ContextInfo context) throws InvalidParameterException, |
698 | |
MissingParameterException, OperationFailedException, |
699 | |
PermissionDeniedException { |
700 | 0 | if (null == context) { |
701 | 0 | throw new MissingParameterException(); |
702 | |
} |
703 | |
|
704 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "searchForActivityOfferingIds", null)) { |
705 | 0 | return getNextDecorator().searchForActivityOfferingIds(criteria, context); |
706 | |
} |
707 | |
else { |
708 | 0 | throw new PermissionDeniedException(); |
709 | |
} |
710 | |
} |
711 | |
|
712 | |
@Override |
713 | |
public List<RegistrationGroupInfo> searchForRegistrationGroups( |
714 | |
QueryByCriteria criteria, ContextInfo context) |
715 | |
throws InvalidParameterException, MissingParameterException, |
716 | |
OperationFailedException, PermissionDeniedException { |
717 | 0 | if (null == context) { |
718 | 0 | throw new MissingParameterException(); |
719 | |
} |
720 | |
|
721 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "searchForRegistrationGroups", null)) { |
722 | 0 | return getNextDecorator().searchForRegistrationGroups(criteria, context); |
723 | |
} |
724 | |
else { |
725 | 0 | throw new PermissionDeniedException(); |
726 | |
} |
727 | |
} |
728 | |
|
729 | |
@Override |
730 | |
public List<String> searchForRegistrationGroupIds(QueryByCriteria criteria, |
731 | |
ContextInfo context) throws InvalidParameterException, |
732 | |
MissingParameterException, OperationFailedException, |
733 | |
PermissionDeniedException { |
734 | 0 | if (null == context) { |
735 | 0 | throw new MissingParameterException(); |
736 | |
} |
737 | |
|
738 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "searchForRegistrationGroupIds", null)) { |
739 | 0 | return getNextDecorator().searchForRegistrationGroupIds(criteria, context); |
740 | |
} |
741 | |
else { |
742 | 0 | throw new PermissionDeniedException(); |
743 | |
} |
744 | |
} |
745 | |
|
746 | |
@Override |
747 | |
public List<SeatPoolDefinitionInfo> searchForSeatpoolDefintions( |
748 | |
QueryByCriteria criteria, ContextInfo context) |
749 | |
throws InvalidParameterException, MissingParameterException, |
750 | |
OperationFailedException, PermissionDeniedException { |
751 | 0 | if (null == context) { |
752 | 0 | throw new MissingParameterException(); |
753 | |
} |
754 | |
|
755 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "searchForSeatpoolDefintions", null)) { |
756 | 0 | return getNextDecorator().searchForSeatpoolDefintions(criteria, context); |
757 | |
} |
758 | |
else { |
759 | 0 | throw new PermissionDeniedException(); |
760 | |
} |
761 | |
} |
762 | |
|
763 | |
@Override |
764 | |
public List<String> searchForSeatpoolDefintionIds(QueryByCriteria criteria, |
765 | |
ContextInfo context) throws InvalidParameterException, |
766 | |
MissingParameterException, OperationFailedException, |
767 | |
PermissionDeniedException { |
768 | 0 | if (null == context) { |
769 | 0 | throw new MissingParameterException(); |
770 | |
} |
771 | |
|
772 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "searchForSeatpoolDefintionIds", null)) { |
773 | 0 | return getNextDecorator().searchForSeatpoolDefintionIds(criteria, context); |
774 | |
} |
775 | |
else { |
776 | 0 | throw new PermissionDeniedException(); |
777 | |
} |
778 | |
} |
779 | |
|
780 | |
@Override |
781 | |
public FormatOfferingInfo createFormatOffering(String courseOfferingId, String formatId, String formatOfferingType, |
782 | |
FormatOfferingInfo formatOfferingInfo, ContextInfo context) throws DoesNotExistException, DataValidationErrorException, InvalidParameterException, |
783 | |
MissingParameterException, OperationFailedException, PermissionDeniedException, |
784 | |
ReadOnlyException { |
785 | 0 | if (null == context) { |
786 | 0 | throw new MissingParameterException(); |
787 | |
} |
788 | |
|
789 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "searchForSeatpoolDefintionIds", null)) { |
790 | 0 | return getNextDecorator().createFormatOffering(courseOfferingId,formatId,formatOfferingType, formatOfferingInfo, context); |
791 | |
} |
792 | |
else { |
793 | 0 | throw new PermissionDeniedException(); |
794 | |
} |
795 | |
} |
796 | |
} |