1 | |
package org.kuali.student.enrollment.class1.lui.service.decorators; |
2 | |
|
3 | |
import org.kuali.rice.core.api.criteria.QueryByCriteria; |
4 | |
import org.kuali.rice.kim.api.permission.PermissionService; |
5 | |
import org.kuali.student.enrollment.lui.dto.LuiCapacityInfo; |
6 | |
import org.kuali.student.enrollment.lui.dto.LuiInfo; |
7 | |
import org.kuali.student.enrollment.lui.dto.LuiLuiRelationInfo; |
8 | |
import org.kuali.student.enrollment.lui.service.LuiServiceDecorator; |
9 | |
import org.kuali.student.r2.common.dto.ContextInfo; |
10 | |
import org.kuali.student.r2.common.dto.StatusInfo; |
11 | |
import org.kuali.student.r2.common.dto.ValidationResultInfo; |
12 | |
import org.kuali.student.r2.common.exceptions.AlreadyExistsException; |
13 | |
import org.kuali.student.r2.common.exceptions.CircularRelationshipException; |
14 | |
import org.kuali.student.r2.common.exceptions.DataValidationErrorException; |
15 | |
import org.kuali.student.r2.common.exceptions.DependentObjectsExistException; |
16 | |
import org.kuali.student.r2.common.exceptions.DoesNotExistException; |
17 | |
import org.kuali.student.r2.common.exceptions.InvalidParameterException; |
18 | |
import org.kuali.student.r2.common.exceptions.MissingParameterException; |
19 | |
import org.kuali.student.r2.common.exceptions.OperationFailedException; |
20 | |
import org.kuali.student.r2.common.exceptions.PermissionDeniedException; |
21 | |
import org.kuali.student.r2.common.exceptions.VersionMismatchException; |
22 | |
import org.kuali.student.r2.common.infc.HoldsPermissionService; |
23 | |
|
24 | |
import java.util.List; |
25 | |
|
26 | 0 | public class LuiServiceAuthorizationDecorator extends LuiServiceDecorator implements HoldsPermissionService{ |
27 | |
public static final String ENRLLMENT_NAMESPACE = "KS-ENROLL"; |
28 | |
public static final String SERVICE_NAME = "LuiService."; |
29 | |
|
30 | |
private PermissionService permissionService; |
31 | |
|
32 | |
@Override |
33 | |
public PermissionService getPermissionService() { |
34 | 0 | return permissionService; |
35 | |
} |
36 | |
|
37 | |
@Override |
38 | |
public void setPermissionService(PermissionService permissionService) { |
39 | 0 | this.permissionService = permissionService; |
40 | 0 | } |
41 | |
|
42 | |
@Override |
43 | |
public LuiInfo getLui(String luiId, ContextInfo context) |
44 | |
throws DoesNotExistException, InvalidParameterException, |
45 | |
MissingParameterException, OperationFailedException { |
46 | 0 | if (null == context) { |
47 | 0 | throw new MissingParameterException(); |
48 | |
} |
49 | |
|
50 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getLui", null, null)) { |
51 | 0 | return getNextDecorator().getLui(luiId, context); |
52 | |
} |
53 | |
else { |
54 | 0 | throw new OperationFailedException("Permission Denied."); |
55 | |
} |
56 | |
} |
57 | |
|
58 | |
@Override |
59 | |
public List<LuiInfo> getLuisByIds(List<String> luiIds, |
60 | |
ContextInfo context) throws DoesNotExistException, |
61 | |
InvalidParameterException, MissingParameterException, |
62 | |
OperationFailedException { |
63 | 0 | if (null == context) { |
64 | 0 | throw new MissingParameterException(); |
65 | |
} |
66 | |
|
67 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getLuisByIds", null, null)) { |
68 | 0 | return getNextDecorator().getLuisByIds(luiIds, context); |
69 | |
} |
70 | |
else { |
71 | 0 | throw new OperationFailedException("Permission Denied."); |
72 | |
} |
73 | |
} |
74 | |
|
75 | |
@Override |
76 | |
public List<String> getLuiIdsByType(String luiTypeKey, ContextInfo context) |
77 | |
throws DoesNotExistException, InvalidParameterException, |
78 | |
MissingParameterException, OperationFailedException { |
79 | 0 | if (null == context) { |
80 | 0 | throw new MissingParameterException(); |
81 | |
} |
82 | |
|
83 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getLuiIdsByType", null, null)) { |
84 | 0 | return getNextDecorator().getLuiIdsByType(luiTypeKey, context); |
85 | |
} |
86 | |
else { |
87 | 0 | throw new OperationFailedException("Permission Denied."); |
88 | |
} |
89 | |
} |
90 | |
|
91 | |
@Override |
92 | |
public List<String> getLuiIdsByCluId(String cluId, ContextInfo context) |
93 | |
throws DoesNotExistException, InvalidParameterException, |
94 | |
MissingParameterException, OperationFailedException { |
95 | 0 | if (null == context) { |
96 | 0 | throw new MissingParameterException(); |
97 | |
} |
98 | |
|
99 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getLuiIdsByCluId", null, null)) { |
100 | 0 | return getNextDecorator().getLuiIdsByCluId(cluId, context); |
101 | |
} |
102 | |
else { |
103 | 0 | throw new OperationFailedException("Permission Denied."); |
104 | |
} |
105 | |
} |
106 | |
|
107 | |
@Override |
108 | |
public List<String> getLuiIdsInAtpByCluId(String cluId, String atpId, |
109 | |
ContextInfo context) throws DoesNotExistException, |
110 | |
InvalidParameterException, MissingParameterException, |
111 | |
OperationFailedException { |
112 | 0 | if (null == context) { |
113 | 0 | throw new MissingParameterException(); |
114 | |
} |
115 | |
|
116 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getLuiIdsInAtpByCluId", null, null)) { |
117 | 0 | return getNextDecorator().getLuiIdsInAtpByCluId(cluId, atpId, context); |
118 | |
} |
119 | |
else { |
120 | 0 | throw new OperationFailedException("Permission Denied."); |
121 | |
} |
122 | |
} |
123 | |
|
124 | |
@Override |
125 | |
public List<LuiInfo> getLuisInAtpByCluId(String cluId, String atpId, |
126 | |
ContextInfo context) throws DoesNotExistException, |
127 | |
InvalidParameterException, MissingParameterException, |
128 | |
OperationFailedException { |
129 | 0 | if (null == context) { |
130 | 0 | throw new MissingParameterException(); |
131 | |
} |
132 | |
|
133 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getLuisInAtpByCluId", null, null)) { |
134 | 0 | return getNextDecorator().getLuisInAtpByCluId(cluId, atpId, context); |
135 | |
} |
136 | |
else { |
137 | 0 | throw new OperationFailedException("Permission Denied."); |
138 | |
} |
139 | |
} |
140 | |
|
141 | |
@Override |
142 | |
public List<String> getLuiIdsByRelation(String relatedLuiId, |
143 | |
String luLuRelationTypeKey, ContextInfo context) |
144 | |
throws InvalidParameterException, MissingParameterException, |
145 | |
OperationFailedException { |
146 | 0 | if (null == context) { |
147 | 0 | throw new MissingParameterException(); |
148 | |
} |
149 | |
|
150 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getLuiIdsByRelation", null, null)) { |
151 | 0 | return getNextDecorator().getLuiIdsByRelation(relatedLuiId, luLuRelationTypeKey, context); |
152 | |
} |
153 | |
else { |
154 | 0 | throw new OperationFailedException("Permission Denied."); |
155 | |
} |
156 | |
} |
157 | |
|
158 | |
@Override |
159 | |
public List<LuiInfo> getLuisByRelation(String relatedLuiId, |
160 | |
String luLuRelationTypeKey, ContextInfo context) |
161 | |
throws InvalidParameterException, MissingParameterException, |
162 | |
OperationFailedException { |
163 | 0 | if (null == context) { |
164 | 0 | throw new MissingParameterException(); |
165 | |
} |
166 | |
|
167 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getLuisByRelation", null, null)) { |
168 | 0 | return getNextDecorator().getLuisByRelation(relatedLuiId, luLuRelationTypeKey, context); |
169 | |
} |
170 | |
else { |
171 | 0 | throw new OperationFailedException("Permission Denied."); |
172 | |
} |
173 | |
} |
174 | |
|
175 | |
@Override |
176 | |
public List<String> getRelatedLuiIdsByLuiId(String luiId, |
177 | |
String luLuRelationTypeKey, ContextInfo context) |
178 | |
throws InvalidParameterException, MissingParameterException, |
179 | |
OperationFailedException { |
180 | 0 | if (null == context) { |
181 | 0 | throw new MissingParameterException(); |
182 | |
} |
183 | |
|
184 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getRelatedLuiIdsByLuiId", null, null)) { |
185 | 0 | return getNextDecorator().getRelatedLuiIdsByLuiId(luiId, luLuRelationTypeKey, context); |
186 | |
} |
187 | |
else { |
188 | 0 | throw new OperationFailedException("Permission Denied."); |
189 | |
} |
190 | |
} |
191 | |
|
192 | |
@Override |
193 | |
public List<LuiInfo> getRelatedLuisByLuiId(String luiId, |
194 | |
String luLuRelationTypeKey, ContextInfo context) |
195 | |
throws InvalidParameterException, MissingParameterException, |
196 | |
OperationFailedException { |
197 | 0 | if (null == context) { |
198 | 0 | throw new MissingParameterException(); |
199 | |
} |
200 | |
|
201 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getRelatedLuisByLuiId", null, null)) { |
202 | 0 | return getNextDecorator().getRelatedLuisByLuiId(luiId, luLuRelationTypeKey, context); |
203 | |
} |
204 | |
else { |
205 | 0 | throw new OperationFailedException("Permission Denied."); |
206 | |
} |
207 | |
} |
208 | |
|
209 | |
@Override |
210 | |
public List<String> searchForLuiIds(QueryByCriteria criteria, |
211 | |
ContextInfo context) throws InvalidParameterException, |
212 | |
MissingParameterException, OperationFailedException, |
213 | |
PermissionDeniedException { |
214 | 0 | if (null == context) { |
215 | 0 | throw new MissingParameterException(); |
216 | |
} |
217 | |
|
218 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "searchForLuiIds", null, null)) { |
219 | 0 | return getNextDecorator().searchForLuiIds(criteria, context); |
220 | |
} |
221 | |
else { |
222 | 0 | throw new PermissionDeniedException(); |
223 | |
} |
224 | |
} |
225 | |
|
226 | |
@Override |
227 | |
public List<LuiInfo> searchForLuis(QueryByCriteria criteria, |
228 | |
ContextInfo context) throws InvalidParameterException, |
229 | |
MissingParameterException, OperationFailedException, |
230 | |
PermissionDeniedException { |
231 | 0 | if (null == context) { |
232 | 0 | throw new MissingParameterException(); |
233 | |
} |
234 | |
|
235 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "searchForLuis", null, null)) { |
236 | 0 | return getNextDecorator().searchForLuis(criteria, context); |
237 | |
} |
238 | |
else { |
239 | 0 | throw new PermissionDeniedException(); |
240 | |
} |
241 | |
} |
242 | |
|
243 | |
@Override |
244 | |
public List<ValidationResultInfo> validateLui(String validationType, |
245 | |
LuiInfo luiInfo, ContextInfo context) throws DoesNotExistException, |
246 | |
InvalidParameterException, MissingParameterException, |
247 | |
OperationFailedException { |
248 | 0 | if (null == context) { |
249 | 0 | throw new MissingParameterException(); |
250 | |
} |
251 | |
|
252 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "validateLui", null, null)) { |
253 | 0 | return getNextDecorator().validateLui(validationType, luiInfo, context); |
254 | |
} |
255 | |
else { |
256 | 0 | throw new OperationFailedException("Permission Denied."); |
257 | |
} |
258 | |
} |
259 | |
|
260 | |
@Override |
261 | |
public LuiInfo createLui(String cluId, String atpId, LuiInfo luiInfo, |
262 | |
ContextInfo context) throws AlreadyExistsException, |
263 | |
DataValidationErrorException, DoesNotExistException, |
264 | |
InvalidParameterException, MissingParameterException, |
265 | |
OperationFailedException, PermissionDeniedException { |
266 | 0 | if (null == context) { |
267 | 0 | throw new MissingParameterException(); |
268 | |
} |
269 | |
|
270 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "createLui", null, null)) { |
271 | 0 | return getNextDecorator().createLui(cluId, atpId, luiInfo, context); |
272 | |
} |
273 | |
else { |
274 | 0 | throw new PermissionDeniedException(); |
275 | |
} |
276 | |
} |
277 | |
|
278 | |
@Override |
279 | |
public LuiInfo updateLui(String luiId, LuiInfo luiInfo, ContextInfo context) |
280 | |
throws DataValidationErrorException, DoesNotExistException, |
281 | |
InvalidParameterException, MissingParameterException, |
282 | |
OperationFailedException, PermissionDeniedException, |
283 | |
VersionMismatchException { |
284 | 0 | if (null == context) { |
285 | 0 | throw new MissingParameterException(); |
286 | |
} |
287 | |
|
288 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "updateLui", null, null)) { |
289 | 0 | return getNextDecorator().updateLui(luiId, luiInfo, context); |
290 | |
} |
291 | |
else { |
292 | 0 | throw new PermissionDeniedException(); |
293 | |
} |
294 | |
} |
295 | |
|
296 | |
@Override |
297 | |
public StatusInfo deleteLui(String luiId, ContextInfo context) |
298 | |
throws DependentObjectsExistException, DoesNotExistException, |
299 | |
InvalidParameterException, MissingParameterException, |
300 | |
OperationFailedException, PermissionDeniedException { |
301 | 0 | if (null == context) { |
302 | 0 | throw new MissingParameterException(); |
303 | |
} |
304 | |
|
305 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "deleteLui", null, null)) { |
306 | 0 | return getNextDecorator().deleteLui(luiId, context); |
307 | |
} |
308 | |
else { |
309 | 0 | throw new PermissionDeniedException(); |
310 | |
} |
311 | |
} |
312 | |
|
313 | |
@Override |
314 | |
public LuiInfo updateLuiState(String luiId, String luState, |
315 | |
ContextInfo context) throws DataValidationErrorException, |
316 | |
DoesNotExistException, InvalidParameterException, |
317 | |
MissingParameterException, OperationFailedException, |
318 | |
PermissionDeniedException { |
319 | 0 | if (null == context) { |
320 | 0 | throw new MissingParameterException(); |
321 | |
} |
322 | |
|
323 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "updateLuiState", null, null)) { |
324 | 0 | return getNextDecorator().updateLuiState(luiId, luState, context); |
325 | |
} |
326 | |
else { |
327 | 0 | throw new PermissionDeniedException(); |
328 | |
} |
329 | |
} |
330 | |
|
331 | |
@Override |
332 | |
public LuiLuiRelationInfo getLuiLuiRelation(String luiLuiRelationId, |
333 | |
ContextInfo context) throws DoesNotExistException, |
334 | |
InvalidParameterException, MissingParameterException, |
335 | |
OperationFailedException { |
336 | 0 | if (null == context) { |
337 | 0 | throw new MissingParameterException(); |
338 | |
} |
339 | |
|
340 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getLuiLuiRelation", null, null)) { |
341 | 0 | return getNextDecorator().getLuiLuiRelation(luiLuiRelationId, context); |
342 | |
} |
343 | |
else { |
344 | 0 | throw new OperationFailedException("Permission Denied."); |
345 | |
} |
346 | |
} |
347 | |
|
348 | |
@Override |
349 | |
public List<LuiLuiRelationInfo> getLuiLuiRelationsByIds( |
350 | |
List<String> luiLuiRelationIds, ContextInfo context) |
351 | |
throws DoesNotExistException, InvalidParameterException, |
352 | |
MissingParameterException, OperationFailedException { |
353 | 0 | if (null == context) { |
354 | 0 | throw new MissingParameterException(); |
355 | |
} |
356 | |
|
357 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getLuiLuiRelationsByIds", null, null)) { |
358 | 0 | return getNextDecorator().getLuiLuiRelationsByIds(luiLuiRelationIds, context); |
359 | |
} |
360 | |
else { |
361 | 0 | throw new OperationFailedException("Permission Denied."); |
362 | |
} |
363 | |
} |
364 | |
|
365 | |
@Override |
366 | |
public List<String> getLuiLuiRelationIdsByType( |
367 | |
String luiLuiRelationTypeKey, ContextInfo context) |
368 | |
throws DoesNotExistException, InvalidParameterException, |
369 | |
MissingParameterException, OperationFailedException { |
370 | 0 | if (null == context) { |
371 | 0 | throw new MissingParameterException(); |
372 | |
} |
373 | |
|
374 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getLuiLuiRelationIdsByType", null, null)) { |
375 | 0 | return getNextDecorator().getLuiLuiRelationIdsByType(luiLuiRelationTypeKey, context); |
376 | |
} |
377 | |
else { |
378 | 0 | throw new OperationFailedException("Permission Denied."); |
379 | |
} |
380 | |
} |
381 | |
|
382 | |
@Override |
383 | |
public List<LuiLuiRelationInfo> getLuiLuiRelationsByLui(String luiId, |
384 | |
ContextInfo context) throws DoesNotExistException, |
385 | |
InvalidParameterException, MissingParameterException, |
386 | |
OperationFailedException { |
387 | 0 | if (null == context) { |
388 | 0 | throw new MissingParameterException(); |
389 | |
} |
390 | |
|
391 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getLuiLuiRelationsByLui", null, null)) { |
392 | 0 | return getNextDecorator().getLuiLuiRelationsByLui(luiId, context); |
393 | |
} |
394 | |
else { |
395 | 0 | throw new OperationFailedException("Permission Denied."); |
396 | |
} |
397 | |
} |
398 | |
|
399 | |
@Override |
400 | |
public List<String> searchForLuiLuiRelationIds(QueryByCriteria criteria, |
401 | |
ContextInfo context) throws InvalidParameterException, |
402 | |
MissingParameterException, OperationFailedException, |
403 | |
PermissionDeniedException { |
404 | 0 | if (null == context) { |
405 | 0 | throw new MissingParameterException(); |
406 | |
} |
407 | |
|
408 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "searchForLuiLuiRelationIds", null, null)) { |
409 | 0 | return getNextDecorator().searchForLuiLuiRelationIds(criteria, context); |
410 | |
} |
411 | |
else { |
412 | 0 | throw new PermissionDeniedException(); |
413 | |
} |
414 | |
} |
415 | |
|
416 | |
@Override |
417 | |
public List<LuiLuiRelationInfo> searchForLuiLuiRelations( |
418 | |
QueryByCriteria criteria, ContextInfo context) |
419 | |
throws InvalidParameterException, MissingParameterException, |
420 | |
OperationFailedException, PermissionDeniedException { |
421 | 0 | if (null == context) { |
422 | 0 | throw new MissingParameterException(); |
423 | |
} |
424 | |
|
425 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "searchForLuiLuiRelations", null, null)) { |
426 | 0 | return getNextDecorator().searchForLuiLuiRelations(criteria, context); |
427 | |
} |
428 | |
else { |
429 | 0 | throw new PermissionDeniedException(); |
430 | |
} |
431 | |
} |
432 | |
|
433 | |
@Override |
434 | |
public List<ValidationResultInfo> validateLuiLuiRelation( |
435 | |
String validationType, LuiLuiRelationInfo luiLuiRelationInfo, |
436 | |
ContextInfo context) throws DoesNotExistException, |
437 | |
InvalidParameterException, MissingParameterException, |
438 | |
OperationFailedException { |
439 | 0 | if (null == context) { |
440 | 0 | throw new MissingParameterException(); |
441 | |
} |
442 | |
|
443 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "validateLuiLuiRelation", null, null)) { |
444 | 0 | return getNextDecorator().validateLuiLuiRelation(validationType, luiLuiRelationInfo, context); |
445 | |
} |
446 | |
else { |
447 | 0 | throw new OperationFailedException("Permission Denied."); |
448 | |
} |
449 | |
} |
450 | |
|
451 | |
@Override |
452 | |
public LuiLuiRelationInfo createLuiLuiRelation(String luiId, |
453 | |
String relatedLuiId, String luLuRelationTypeKey, |
454 | |
LuiLuiRelationInfo luiLuiRelationInfo, ContextInfo context) |
455 | |
throws AlreadyExistsException, CircularRelationshipException, |
456 | |
DataValidationErrorException, DoesNotExistException, |
457 | |
InvalidParameterException, MissingParameterException, |
458 | |
OperationFailedException, PermissionDeniedException { |
459 | 0 | if (null == context) { |
460 | 0 | throw new MissingParameterException(); |
461 | |
} |
462 | |
|
463 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "createLuiLuiRelation", null, null)) { |
464 | 0 | return getNextDecorator().createLuiLuiRelation(luiId, relatedLuiId, luLuRelationTypeKey, luiLuiRelationInfo, context); |
465 | |
} |
466 | |
else { |
467 | 0 | throw new PermissionDeniedException(); |
468 | |
} |
469 | |
} |
470 | |
|
471 | |
@Override |
472 | |
public LuiLuiRelationInfo updateLuiLuiRelation(String luiLuiRelationId, |
473 | |
LuiLuiRelationInfo luiLuiRelationInfo, ContextInfo context) |
474 | |
throws DataValidationErrorException, DoesNotExistException, |
475 | |
InvalidParameterException, MissingParameterException, |
476 | |
OperationFailedException, PermissionDeniedException, |
477 | |
VersionMismatchException { |
478 | 0 | if (null == context) { |
479 | 0 | throw new MissingParameterException(); |
480 | |
} |
481 | |
|
482 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "updateLuiLuiRelation", null, null)) { |
483 | 0 | return getNextDecorator().updateLuiLuiRelation(luiLuiRelationId, luiLuiRelationInfo, context); |
484 | |
} |
485 | |
else { |
486 | 0 | throw new PermissionDeniedException(); |
487 | |
} |
488 | |
} |
489 | |
|
490 | |
@Override |
491 | |
public StatusInfo deleteLuiLuiRelation(String luiLuiRelationId, |
492 | |
ContextInfo context) throws DoesNotExistException, |
493 | |
InvalidParameterException, MissingParameterException, |
494 | |
OperationFailedException, PermissionDeniedException { |
495 | 0 | if (null == context) { |
496 | 0 | throw new MissingParameterException(); |
497 | |
} |
498 | |
|
499 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "deleteLuiLuiRelation", null, null)) { |
500 | 0 | return getNextDecorator().deleteLuiLuiRelation(luiLuiRelationId, context); |
501 | |
} |
502 | |
else { |
503 | 0 | throw new PermissionDeniedException(); |
504 | |
} |
505 | |
} |
506 | |
|
507 | |
@Override |
508 | |
public LuiCapacityInfo getLuiCapacity(String luiCapacityId, |
509 | |
ContextInfo context) throws DoesNotExistException, |
510 | |
InvalidParameterException, MissingParameterException, |
511 | |
OperationFailedException { |
512 | 0 | if (null == context) { |
513 | 0 | throw new MissingParameterException(); |
514 | |
} |
515 | |
|
516 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getLuiCapacity", null, null)) { |
517 | 0 | return getNextDecorator().getLuiCapacity(luiCapacityId, context); |
518 | |
} |
519 | |
else { |
520 | 0 | throw new OperationFailedException("Permission Denied."); |
521 | |
} |
522 | |
} |
523 | |
|
524 | |
@Override |
525 | |
public List<LuiCapacityInfo> getLuiCapacitiesByIds( |
526 | |
List<String> luiCapacityIds, ContextInfo context) |
527 | |
throws DoesNotExistException, InvalidParameterException, |
528 | |
MissingParameterException, OperationFailedException { |
529 | 0 | if (null == context) { |
530 | 0 | throw new MissingParameterException(); |
531 | |
} |
532 | |
|
533 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getLuiCapacitiesByIds", null, null)) { |
534 | 0 | return getNextDecorator().getLuiCapacitiesByIds(luiCapacityIds, context); |
535 | |
} |
536 | |
else { |
537 | 0 | throw new OperationFailedException("Permission Denied."); |
538 | |
} |
539 | |
} |
540 | |
|
541 | |
@Override |
542 | |
public List<String> getLuiCapacityIdsByType(String luiCapacityTypeKey, |
543 | |
ContextInfo context) throws DoesNotExistException, |
544 | |
InvalidParameterException, MissingParameterException, |
545 | |
OperationFailedException { |
546 | 0 | if (null == context) { |
547 | 0 | throw new MissingParameterException(); |
548 | |
} |
549 | |
|
550 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "getLuiCapacityIdsByType", null, null)) { |
551 | 0 | return getNextDecorator().getLuiCapacityIdsByType(luiCapacityTypeKey, context); |
552 | |
} |
553 | |
else { |
554 | 0 | throw new OperationFailedException("Permission Denied."); |
555 | |
} |
556 | |
} |
557 | |
|
558 | |
@Override |
559 | |
public List<String> searchForLuiCapacityIds(QueryByCriteria criteria, |
560 | |
ContextInfo context) throws InvalidParameterException, |
561 | |
MissingParameterException, OperationFailedException, |
562 | |
PermissionDeniedException { |
563 | 0 | if (null == context) { |
564 | 0 | throw new MissingParameterException(); |
565 | |
} |
566 | |
|
567 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "searchForLuiCapacityIds", null, null)) { |
568 | 0 | return getNextDecorator().searchForLuiCapacityIds(criteria, context); |
569 | |
} |
570 | |
else { |
571 | 0 | throw new PermissionDeniedException(); |
572 | |
} |
573 | |
} |
574 | |
|
575 | |
@Override |
576 | |
public List<LuiCapacityInfo> searchForLuiCapacities( |
577 | |
QueryByCriteria criteria, ContextInfo context) |
578 | |
throws InvalidParameterException, MissingParameterException, |
579 | |
OperationFailedException, PermissionDeniedException { |
580 | 0 | if (null == context) { |
581 | 0 | throw new MissingParameterException(); |
582 | |
} |
583 | |
|
584 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "searchForLuiCapacities", null, null)) { |
585 | 0 | return getNextDecorator().searchForLuiCapacities(criteria, context); |
586 | |
} |
587 | |
else { |
588 | 0 | throw new PermissionDeniedException(); |
589 | |
} |
590 | |
} |
591 | |
|
592 | |
@Override |
593 | |
public List<ValidationResultInfo> validateLuiCapacity( |
594 | |
String validationType, LuiCapacityInfo luiCapacityInfo, |
595 | |
ContextInfo context) throws DoesNotExistException, |
596 | |
InvalidParameterException, MissingParameterException, |
597 | |
OperationFailedException { |
598 | 0 | if (null == context) { |
599 | 0 | throw new MissingParameterException(); |
600 | |
} |
601 | |
|
602 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "validateLuiCapacity", null, null)) { |
603 | 0 | return getNextDecorator().validateLuiCapacity(validationType, luiCapacityInfo, context); |
604 | |
} |
605 | |
else { |
606 | 0 | throw new OperationFailedException("Permission Denied."); |
607 | |
} |
608 | |
} |
609 | |
|
610 | |
@Override |
611 | |
public LuiCapacityInfo createLuiCapacity(LuiCapacityInfo luiCapacityInfo, |
612 | |
ContextInfo context) throws AlreadyExistsException, |
613 | |
DataValidationErrorException, DoesNotExistException, |
614 | |
InvalidParameterException, MissingParameterException, |
615 | |
OperationFailedException, PermissionDeniedException { |
616 | 0 | if (null == context) { |
617 | 0 | throw new MissingParameterException(); |
618 | |
} |
619 | |
|
620 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "createLuiCapacity", null, null)) { |
621 | 0 | return getNextDecorator().createLuiCapacity(luiCapacityInfo, context); |
622 | |
} |
623 | |
else { |
624 | 0 | throw new PermissionDeniedException(); |
625 | |
} |
626 | |
} |
627 | |
|
628 | |
@Override |
629 | |
public LuiCapacityInfo updateLuiCapacity(String luiCapacityId, |
630 | |
LuiCapacityInfo luiCapacityInfo, ContextInfo context) |
631 | |
throws DataValidationErrorException, DoesNotExistException, |
632 | |
InvalidParameterException, MissingParameterException, |
633 | |
OperationFailedException, PermissionDeniedException, |
634 | |
VersionMismatchException { |
635 | 0 | if (null == context) { |
636 | 0 | throw new MissingParameterException(); |
637 | |
} |
638 | |
|
639 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "updateLuiCapacity", null, null)) { |
640 | 0 | return getNextDecorator().updateLuiCapacity(luiCapacityId, luiCapacityInfo, context); |
641 | |
} |
642 | |
else { |
643 | 0 | throw new PermissionDeniedException(); |
644 | |
} |
645 | |
} |
646 | |
|
647 | |
@Override |
648 | |
public StatusInfo deleteLuiCapacity(String luiCapacityId, |
649 | |
ContextInfo context) throws DependentObjectsExistException, |
650 | |
DoesNotExistException, InvalidParameterException, |
651 | |
MissingParameterException, OperationFailedException, |
652 | |
PermissionDeniedException { |
653 | 0 | if (null == context) { |
654 | 0 | throw new MissingParameterException(); |
655 | |
} |
656 | |
|
657 | 0 | if (permissionService.isAuthorized(context.getPrincipalId(), ENRLLMENT_NAMESPACE, SERVICE_NAME + "deleteLuiCapacity", null, null)) { |
658 | 0 | return getNextDecorator().deleteLuiCapacity(luiCapacityId, context); |
659 | |
} |
660 | |
else { |
661 | 0 | throw new PermissionDeniedException(); |
662 | |
} |
663 | |
} |
664 | |
|
665 | |
|
666 | |
} |