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.pdp.document.authorization;
17:
18: import java.util.Map;
19:
20: import org.kuali.core.bo.user.UniversalUser;
21: import org.kuali.core.document.Document;
22: import org.kuali.core.document.authorization.MaintenanceDocumentAuthorizerBase;
23: import org.kuali.module.pdp.PdpAuthorizationConstants;
24:
25: public class PayeeAchAccountDocumentAuthorizer extends
26: MaintenanceDocumentAuthorizerBase {
27:
28: /**
29: * If the current user is a member of KUALI_PDP_VIEWALL then add entry to the editMode Map and set it true.
30: *
31: * @see org.kuali.core.document.MaintenanceDocumentAuthorizerBase#getEditMode(org.kuali.core.document.Document,
32: * org.kuali.core.bo.user.KualiUser)
33: */
34: @Override
35: public Map getEditMode(Document document, UniversalUser user) {
36: Map editMode = super .getEditMode(document, user);
37: // String viewAllWorkgroup = SpringContext.getBean(ParameterService.class).getParameterValue(PayeeAchAccount.class,
38: // PdpConstants.Groups.VIEWALL_GROUP);
39: String viewAllWorkgroup = "KUALI_PDP_ACH";
40:
41: if (user.isMember(viewAllWorkgroup)) {
42: editMode.put(PdpAuthorizationConstants.PDPEditMode.ENTRY,
43: "TRUE");
44: }
45:
46: return editMode;
47: }
48: }
|