1 /**
2 * Copyright 2005-2014 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
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.rice.krad.document;
17
18 import org.kuali.rice.kim.api.identity.Person;
19 import org.kuali.rice.krad.bo.DataObjectAuthorizer;
20
21 /**
22 * Authorizer class for {@link Document} instances
23 *
24 * <p>
25 * Authorizer provides user based authorization
26 * </p>
27 *
28 * <p>
29 * The document authorizer is associated with a document type through its data dictionary
30 * {@link org.kuali.rice.krad.datadictionary.DocumentEntry}. This is then used by the framework to authorize certain
31 * actions and in addition used for view presentation logic
32 * </p>
33 *
34 * @author Kuali Rice Team (rice.collab@kuali.org)
35 */
36 public interface DocumentAuthorizer extends DataObjectAuthorizer {
37
38 /**
39 * Checks if a user has the permissions to initiate a document
40 *
41 * @param documentTypeName document type name
42 * @param user current user
43 * @return boolean, true if the user has the permissions to initiate a document else false
44 */
45
46 public boolean canInitiate(String documentTypeName, Person user);
47
48 /**
49 * Checks if a user has the permissions to open a document
50 *
51 * @param document document to check
52 * @param user current user
53 * @return boolean, true if the user has the permissions to open a document else false
54 */
55
56 public boolean canOpen(Document document, Person user);
57
58 /**
59 * Determines if the document can be edited; if false is returned, then all fields are in a
60 * read only state
61 *
62 * @param document document to check
63 * @param user current user
64 * @return boolean, true if the user has the permissions to edit a document else false
65 */
66
67 public boolean canEdit(Document document, Person user);
68
69 public boolean canAnnotate(Document document, Person user);
70
71 public boolean canReload(Document document, Person user);
72
73 public boolean canClose(Document document, Person user);
74
75 public boolean canSave(Document document, Person user);
76
77 /**
78 * Determines if the user has permission to route the document
79 *
80 * @param document document to check
81 * @param user current user
82 * @return boolean, true if the user has permissions to route a document else false
83 */
84 public boolean canRoute(Document document, Person user);
85
86 /**
87 * Determines if the user has permission to cancel the document
88 *
89 * @param document document to check
90 * @param user current user
91 * @return boolean, true if the user has permissions to cancel a document else false
92 */
93 public boolean canCancel(Document document, Person user);
94
95 /**
96 * Determines if the user has permission to copy the document
97 *
98 * @param document document to check
99 * @param user current user
100 * @return boolean, true if the user has permissions to cancel a document else false
101 */
102 public boolean canCopy(Document document, Person user);
103
104 public boolean canPerformRouteReport(Document document, Person user);
105
106 public boolean canBlanketApprove(Document document, Person user);
107
108 public boolean canApprove(Document document, Person user);
109
110 public boolean canDisapprove(Document document, Person user);
111
112 public boolean canSendNoteFyi(Document document, Person user);
113
114 public boolean canEditDocumentOverview(Document document, Person user);
115
116 public boolean canFyi(Document document, Person user);
117
118 public boolean canAcknowledge(Document document, Person user);
119
120 public boolean canReceiveAdHoc(Document document, Person user, String actionRequestCode);
121
122 public boolean canAddNoteAttachment(Document document, String attachmentTypeCode, Person user);
123
124 public boolean canDeleteNoteAttachment(Document document, String attachmentTypeCode,
125 String authorUniversalIdentifier, Person user);
126
127 public boolean canViewNoteAttachment(Document document, String attachmentTypeCode, String authorUniversalIdentifier,
128 Person user);
129
130 public boolean canSendAdHocRequests(Document document, String actionRequestCd, Person user);
131
132 public boolean canSendAnyTypeAdHocRequests(Document document, Person user);
133
134 public boolean canTakeRequestedAction(Document document, String actionRequestCode, Person user);
135
136 /**
137 * @since 2.1
138 */
139 public boolean canRecall(Document document, Person user);
140
141 /**
142 * Determines if the user has permission to take a super user action.
143 *
144 * @param document document to check
145 * @param user current user
146 *
147 * @return true if the user has permissions to take a super user action, otherwise false
148 *
149 * @since 2.5
150 */
151 boolean canSuperUserTakeAction(Document document, Person user);
152
153 /**
154 * Determines if the user has permission to approve a document as a super user.
155 *
156 * @param document document to check
157 * @param user current user
158 *
159 * @return true if the user has permissions to approve a document as a super user, otherwise false
160 * @since 2.5
161 */
162 boolean canSuperUserApprove(Document document, Person user);
163
164 /**
165 * Determines if the user has permission to disapprove a document as a super user.
166 *
167 * @param document document to check
168 * @param user current user
169 *
170 * @return true if the user has permissions to disapprove a document as a super user, otherwise false
171 * @since 2.5
172 */
173 boolean canSuperUserDisapprove(Document document, Person user);
174
175 }