01: /*
02: * Copyright 2006-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.chart.document;
17:
18: import org.kuali.core.bo.user.UniversalUser;
19: import org.kuali.core.document.MaintenanceDocument;
20: import org.kuali.core.document.authorization.MaintenanceDocumentAuthorizations;
21: import org.kuali.core.document.authorization.MaintenanceDocumentAuthorizerBase;
22: import org.kuali.kfs.KFSConstants;
23:
24: /**
25: * This class provides specific field-level authorizations for Chart documents
26: */
27: public class ChartUserDocumentAuthorizer extends
28: MaintenanceDocumentAuthorizerBase {
29:
30: /**
31: * Overrides the base implementation to add read only auth field = universalUser.personUserIdentifier
32: *
33: * @see org.kuali.core.document.authorization.MaintenanceDocumentAuthorizerBase#getFieldAuthorizations(org.kuali.core.document.MaintenanceDocument,
34: * org.kuali.core.bo.user.UniversalUser)
35: */
36: @Override
37: public MaintenanceDocumentAuthorizations getFieldAuthorizations(
38: MaintenanceDocument document, UniversalUser user) {
39: MaintenanceDocumentAuthorizations auths = super
40: .getFieldAuthorizations(document, user);
41: if (auths == null)
42: auths = new MaintenanceDocumentAuthorizations();
43: if (KFSConstants.MAINTENANCE_EDIT_ACTION.equals(document
44: .getNewMaintainableObject().getMaintenanceAction())) {
45: auths
46: .addReadonlyAuthField("universalUser.personUserIdentifier");
47: }
48: return auths;
49: }
50:
51: }
|