01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.financial.document.authorization;
17:
18: import java.util.Map;
19:
20: import org.kuali.core.authorization.AuthorizationConstants;
21: import org.kuali.core.bo.user.UniversalUser;
22: import org.kuali.core.document.Document;
23: import org.kuali.core.document.authorization.MaintenanceDocumentAuthorizerBase;
24: import org.kuali.kfs.KFSConstants;
25: import org.kuali.kfs.context.SpringContext;
26: import org.kuali.kfs.service.ParameterService;
27: import org.kuali.module.financial.document.DisbursementVoucherDocument;
28:
29: /**
30: * Document Authorizer for the Payee maintenance document.
31: */
32: public class PayeeDocumentAuthorizer extends
33: MaintenanceDocumentAuthorizerBase {
34:
35: /**
36: * @see org.kuali.core.document.MaintenanceDocumentAuthorizerBase#getEditMode(org.kuali.core.document.Document,
37: * org.kuali.core.bo.user.KualiUser)
38: */
39: @Override
40: public Map getEditMode(Document document, UniversalUser user) {
41: Map editMode = super .getEditMode(document, user);
42:
43: if (user
44: .isMember(SpringContext
45: .getBean(ParameterService.class)
46: .getParameterValue(
47: DisbursementVoucherDocument.class,
48: KFSConstants.FinancialApcParms.DV_TAX_WORKGROUP))) {
49: editMode
50: .put(
51: AuthorizationConstants.DisbursementVoucherEditMode.TAX_ENTRY,
52: "TRUE");
53: }
54:
55: return editMode;
56: }
57:
58: }
|