001 /*
002 * Copyright 2011 The Kuali Foundation.
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.kfs.pdp.service.impl;
017
018 import org.kuali.kfs.pdp.PdpConstants;
019 import org.kuali.kfs.pdp.service.PdpAuthorizationService;
020 import org.kuali.kfs.sys.KFSConstants;
021 import org.kuali.rice.kim.bo.impl.KimAttributes;
022 import org.kuali.rice.kim.bo.types.dto.AttributeSet;
023 import org.kuali.rice.kim.service.KIMServiceLocator;
024
025 public class PdpAuthorizationServiceImpl implements PdpAuthorizationService {
026
027 /**
028 * @see org.kuali.kfs.pdp.service.PdpAuthorizationService#hasCancelPayment(java.lang.String)
029 */
030 public boolean hasCancelPaymentPermission(String principalId) {
031 return KIMServiceLocator.getIdentityManagementService().isAuthorized(principalId, KFSConstants.ParameterNamespaces.PDP, PdpConstants.PermissionNames.CANCEL_PAYMENT, null, null);
032 }
033
034 /**
035 * @see org.kuali.kfs.pdp.service.PdpAuthorizationService#hasFormat(java.lang.String, java.lang.String)
036 */
037 public boolean hasFormatPermission(String principalId) {
038 return KIMServiceLocator.getIdentityManagementService().isAuthorized(principalId, KFSConstants.ParameterNamespaces.PDP, PdpConstants.PermissionNames.FORMAT, null, null);
039 }
040
041 /**
042 * @see org.kuali.kfs.pdp.service.PdpAuthorizationService#hasHoldPayment(java.lang.String)
043 */
044 public boolean hasHoldPaymentPermission(String principalId) {
045 return KIMServiceLocator.getIdentityManagementService().isAuthorized(principalId, KFSConstants.ParameterNamespaces.PDP, PdpConstants.PermissionNames.HOLD_PAYMENT_REMOVE_NON_TAX_PAYMENT_HOLD, null, null);
046 }
047
048 /**
049 * @see org.kuali.kfs.pdp.service.PdpAuthorizationService#hasRemoveFormatLock(java.lang.String, java.lang.String)
050 */
051 public boolean hasRemoveFormatLockPermission(String principalId) {
052 return KIMServiceLocator.getIdentityManagementService().isAuthorized(principalId, KFSConstants.ParameterNamespaces.PDP, PdpConstants.PermissionNames.REMOVE_FORMAT_LOCK, null, null);
053 }
054
055
056 /**
057 * @see org.kuali.kfs.pdp.service.PdpAuthorizationService#hasRemovePaymentTaxHold(java.lang.String)
058 */
059 public boolean hasRemovePaymentTaxHoldPermission(String principalId) {
060 return KIMServiceLocator.getIdentityManagementService().isAuthorized(principalId, KFSConstants.ParameterNamespaces.PDP, PdpConstants.PermissionNames.REMOVE_PAYMENT_TAX_HOLD, null, null);
061 }
062
063 /**
064 * @see org.kuali.kfs.pdp.service.PdpAuthorizationService#hasSetAsImmediatePay(java.lang.String, java.lang.String)
065 */
066 public boolean hasSetAsImmediatePayPermission(String principalId) {
067 return KIMServiceLocator.getIdentityManagementService().isAuthorized(principalId, KFSConstants.ParameterNamespaces.PDP, PdpConstants.PermissionNames.SET_AS_IMMEDIATE_PAY, null, null);
068 }
069
070 }