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.HashMap;
19: import java.util.List;
20: import java.util.Map;
21:
22: import org.kuali.core.bo.user.UniversalUser;
23: import org.kuali.core.document.Document;
24: import org.kuali.core.document.TransactionalDocument;
25: import org.kuali.core.document.authorization.DocumentActionFlags;
26: import org.kuali.core.document.authorization.TransactionalDocumentActionFlags;
27: import org.kuali.kfs.bo.AccountingLine;
28: import org.kuali.kfs.document.authorization.AccountingDocumentAuthorizerBase;
29: import org.kuali.module.chart.bo.ChartUser;
30:
31: /**
32: * Authorization permissions specific to the Credit Card Receipt document.
33: */
34: public class CreditCardReceiptDocumentAuthorizer extends
35: AccountingDocumentAuthorizerBase {
36:
37: /**
38: * Overrides to use the parent's implementation, with the exception that CCR docs can't be error corrected.
39: *
40: * @see org.kuali.core.authorization.DocumentAuthorizer#getDocumentActionFlags(org.kuali.core.document.Document,
41: * org.kuali.core.bo.user.KualiUser)
42: */
43: public DocumentActionFlags getDocumentActionFlags(
44: Document document, UniversalUser user) {
45: DocumentActionFlags flags = super .getDocumentActionFlags(
46: document, user);
47:
48: TransactionalDocumentActionFlags tflags = (TransactionalDocumentActionFlags) flags;
49: tflags.setCanErrorCorrect(false); // CCR, CR, DV, andd PCDO don't allow error correction
50:
51: return flags;
52: }
53:
54: /**
55: * Overrides to always return false because there is never FO routing or FO approval for CCR docs.
56: *
57: * @see org.kuali.module.financial.document.FinancialDocumentAuthorizer#userOwnsAnyAccountingLine(org.kuali.core.bo.user.KualiUser,
58: * java.util.List)
59: */
60: protected boolean userOwnsAnyAccountingLine(ChartUser user,
61: List accountingLines) {
62: return false;
63: }
64:
65: /**
66: * Overrides parent to return an empty Map since FO routing doesn't apply to the CCR doc.
67: *
68: * @see org.kuali.core.authorization.TransactionalDocumentAuthorizer#getEditableAccounts(org.kuali.core.document.TransactionalDocument,
69: * org.kuali.core.bo.user.KualiUser)
70: */
71: public Map getEditableAccounts(TransactionalDocument document,
72: ChartUser user) {
73: return new HashMap();
74: }
75:
76: /**
77: * Overrides parent to return an empty Map since FO routing doesn't apply to the CCR doc.
78: *
79: * @see org.kuali.kfs.document.authorization.AccountingDocumentAuthorizerBase#getEditableAccounts(java.util.List,
80: * org.kuali.module.chart.bo.ChartUser)
81: */
82: @Override
83: public Map getEditableAccounts(List<AccountingLine> lines,
84: ChartUser user) {
85: return new HashMap();
86: }
87:
88: }
|