View Javadoc

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       * Checks if a user has the permissions to initiate a  document
39       *
40       * @param documentTypeName, user
41       * @return boolean, true if the user has the permissions to initiate a document else false
42       */
43  
44      public boolean canInitiate(String documentTypeName, Person user);
45  
46      /**
47       * Checks if a user has the permissions to open a  document
48       *
49       * @param document, user
50       * @return boolean, true if the user has the permissions to open a document else false
51       */
52  
53      public boolean canOpen(Document document, Person user);
54  
55      /**
56       * Determines if the document can be edited; if false is returned, then all fields are in a
57       * read only state
58       *
59       * @param document, user
60       * @return boolean, true if the user has the permissions to edit a document else false
61       */
62  
63      public boolean canEdit(Document document, Person user);
64  
65      public boolean canAnnotate(Document document, Person user);
66  
67      public boolean canReload(Document document, Person user);
68  
69      public boolean canClose(Document document, Person user);
70  
71      public boolean canSave(Document document, Person user);
72  
73      /**
74       * Determines if the user has permission to route the document
75       *
76       * @param document, user
77       * @return boolean, true if the user has permissions to route a document else false
78       */
79      public boolean canRoute(Document document, Person user);
80  
81      /**
82       * Determines if the user has permission to cancel the document
83       *
84       * @param document, user
85       * @return boolean, true if the user has permissions to cancel a document else false
86       */
87      public boolean canCancel(Document document, Person user);
88  
89      /**
90       * Determines if the user has permission to copy the document
91       *
92       * @param document, user
93       * @return boolean, true if the user has permissions to cancel a document else false
94       */
95      public boolean canCopy(Document document, Person user);
96  
97      public boolean canPerformRouteReport(Document document, Person user);
98  
99      public boolean canBlanketApprove(Document document, Person user);
100 
101     public boolean canApprove(Document document, Person user);
102 
103     public boolean canDisapprove(Document document, Person user);
104 
105     public boolean canSendNoteFyi(Document document, Person user);
106 
107     public boolean canEditDocumentOverview(Document document, Person user);
108 
109     public boolean canFyi(Document document, Person user);
110 
111     public boolean canAcknowledge(Document document, Person user);
112 
113     public boolean canReceiveAdHoc(Document document, Person user, String actionRequestCode);
114 
115     public boolean canAddNoteAttachment(Document document, String attachmentTypeCode, Person user);
116 
117     public boolean canDeleteNoteAttachment(Document document, String attachmentTypeCode,
118             String authorUniversalIdentifier, Person user);
119 
120     public boolean canViewNoteAttachment(Document document, String attachmentTypeCode, String authorUniversalIdentifier,
121             Person user);
122 
123     public boolean canSendAdHocRequests(Document document, String actionRequestCd, Person user);
124 
125     public boolean canSendAnyTypeAdHocRequests(Document document, Person user);
126 
127     public boolean canTakeRequestedAction(Document document, String actionRequestCode, Person user);
128 
129     /**
130      * @since 2.1
131      */
132     public boolean canRecall(Document document, Person user);
133 }