View Javadoc
1   /*
2    * Copyright 2009 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.fp.document.authorization;
17  
18  import java.util.Map;
19  
20  import org.kuali.ole.fp.businessobject.CashDrawer;
21  import org.kuali.ole.sys.document.authorization.FinancialSystemMaintenanceDocumentAuthorizerBase;
22  import org.kuali.rice.kim.api.KimConstants;
23  
24  /**
25   * Overridden to add extra role qualifications
26   */
27  public class CashDrawerMaintenanceDocumentAuthorizer extends FinancialSystemMaintenanceDocumentAuthorizerBase {
28  
29      /**
30       * Overridden to add the cash drawer's campus code to the qualification
31       * @see org.kuali.rice.krad.document.authorization.MaintenanceDocumentAuthorizerBase#addRoleQualification(org.kuali.rice.krad.bo.BusinessObject, java.util.Map)
32       */
33      @Override
34      protected void addRoleQualification(Object dataObject, Map<String, String> qualifications) {
35          super.addRoleQualification(dataObject, qualifications);
36          
37          if (dataObject instanceof CashDrawer) {
38              final CashDrawer cashDrawer = (CashDrawer)dataObject;
39              qualifications.put(KimConstants.AttributeConstants.CAMPUS_CODE, cashDrawer.getCampusCode());
40          }
41      }
42  
43      /**
44       * @see org.kuali.rice.krad.document.authorization.MaintenanceDocumentAuthorizerBase#addPermissionDetails(org.kuali.rice.krad.bo.BusinessObject, java.util.Map)
45       */
46      @Override
47      protected void addPermissionDetails(Object dataObject, Map<String, String> permissionDetails) {
48          super.addPermissionDetails(dataObject, permissionDetails);
49          if (dataObject instanceof CashDrawer) {
50              permissionDetails.put(KimConstants.AttributeConstants.DOCUMENT_TYPE_NAME, "CDS");
51          }
52      }
53  
54  }