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.core.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:
23: /**
24: * The DocumentAuthorizer class associated with a given Document is used to dynamically determine what editing mode and what actions
25: * are allowed for a given user on a given document instance.
26: *
27: *
28: */
29: public interface DocumentAuthorizer {
30: /**
31: * @param document
32: * @param user
33: * @return Map with keys AuthorizationConstants.EditMode value (String) which indicates what operations the user is currently
34: * allowed to take on that document.
35: */
36: public Map getEditMode(Document document, UniversalUser user);
37:
38: /**
39: * @param document
40: * @param user
41: * @return DocumentActionFlags instance indicating which actions are permitted the given user on the given document
42: */
43: public DocumentActionFlags getDocumentActionFlags(
44: Document document, UniversalUser user);
45:
46: /**
47: * @param documentTypeName
48: * @param user
49: * @return true if the given user is allowed to initiate documents of the given document type
50: */
51: public void canInitiate(String documentTypeName, UniversalUser user);
52:
53: /**
54: * @param documentTypeName
55: * @param user
56: * @returns boolean indicating whether a user can copy a document
57: */
58: public boolean canCopy(String documentTypeName, UniversalUser user);
59:
60: /**
61: *
62: * @param attachmentTypeName
63: * @param document
64: * @param user
65: * @return
66: */
67: public boolean canViewAttachment(String attachmentTypeName,
68: Document document, UniversalUser user);
69: }
|