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.purap.document.authorization;
17:
18: import org.kuali.core.bo.user.UniversalUser;
19: import org.kuali.core.document.Document;
20: import org.kuali.core.document.authorization.DocumentActionFlags;
21: import org.kuali.core.document.authorization.TransactionalDocumentAuthorizerBase;
22: import org.kuali.core.workflow.service.KualiWorkflowDocument;
23:
24: /**
25: * Document Authorizer for the Assign Contract Manager document.
26: */
27: public class AssignContractManagerDocumentAuthorizer extends
28: TransactionalDocumentAuthorizerBase {
29:
30: /**
31: * @see org.kuali.core.document.authorization.DocumentAuthorizer#getDocumentActionFlags(org.kuali.core.document.Document,
32: * org.kuali.core.bo.user.UniversalUser)
33: */
34: @Override
35: public DocumentActionFlags getDocumentActionFlags(
36: Document document, UniversalUser user) {
37: DocumentActionFlags flags = super .getDocumentActionFlags(
38: document, user);
39: KualiWorkflowDocument workflowDocument = document
40: .getDocumentHeader().getWorkflowDocument();
41:
42: if (workflowDocument.stateIsInitiated()
43: || workflowDocument.stateIsSaved()) {
44: // do not allow this document to be saved; once initiated, it must be routed or canceled
45: flags.setCanSave(false);
46: }
47:
48: // NEED TO REDO ANNOTATE CHECK SINCE CHANGED THE VALUE OF FLAGS
49: this.setAnnotateFlag(flags);
50:
51: return flags;
52: }
53:
54: }
|