1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.pdp.service.impl;
17
18 import org.kuali.ole.pdp.PdpConstants;
19 import org.kuali.ole.pdp.service.PdpAuthorizationService;
20 import org.kuali.ole.sys.OLEConstants;
21 import org.kuali.ole.sys.context.SpringContext;
22 import org.kuali.rice.kim.api.services.IdentityManagementService;
23
24 public class PdpAuthorizationServiceImpl implements PdpAuthorizationService {
25
26 private IdentityManagementService identityManagementService;
27
28
29
30
31 @Override
32 public boolean hasCancelPaymentPermission(String principalId) {
33 return getIdentityManagementService().isAuthorized(principalId, OLEConstants.CoreModuleNamespaces.PDP, PdpConstants.PermissionNames.CANCEL_PAYMENT, null);
34 }
35
36
37
38
39 @Override
40 public boolean hasFormatPermission(String principalId) {
41 return getIdentityManagementService().isAuthorized(principalId, OLEConstants.CoreModuleNamespaces.PDP, PdpConstants.PermissionNames.FORMAT, null);
42 }
43
44
45
46
47 @Override
48 public boolean hasHoldPaymentPermission(String principalId) {
49 return getIdentityManagementService().isAuthorized(principalId, OLEConstants.CoreModuleNamespaces.PDP, PdpConstants.PermissionNames.HOLD_PAYMENT_REMOVE_NON_TAX_PAYMENT_HOLD, null);
50 }
51
52
53
54
55 @Override
56 public boolean hasRemoveFormatLockPermission(String principalId) {
57 return getIdentityManagementService().isAuthorized(principalId, OLEConstants.CoreModuleNamespaces.PDP, PdpConstants.PermissionNames.REMOVE_FORMAT_LOCK, null);
58 }
59
60
61
62
63
64 @Override
65 public boolean hasRemovePaymentTaxHoldPermission(String principalId) {
66 return getIdentityManagementService().isAuthorized(principalId, OLEConstants.CoreModuleNamespaces.PDP, PdpConstants.PermissionNames.REMOVE_PAYMENT_TAX_HOLD, null);
67 }
68
69
70
71
72 @Override
73 public boolean hasSetAsImmediatePayPermission(String principalId) {
74 return getIdentityManagementService().isAuthorized(principalId, OLEConstants.CoreModuleNamespaces.PDP, PdpConstants.PermissionNames.SET_AS_IMMEDIATE_PAY, null);
75 }
76
77 public IdentityManagementService getIdentityManagementService() {
78 if ( identityManagementService == null ) {
79 identityManagementService = SpringContext.getBean(IdentityManagementService.class);
80 }
81 return identityManagementService;
82 }
83
84 }