001 /**
002 * Copyright 2005-2014 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.krad.document;
017
018 import org.kuali.rice.kim.api.identity.Person;
019 import org.kuali.rice.krad.bo.DataObjectAuthorizer;
020
021 /**
022 * Authorizer class for {@link Document} instances
023 *
024 * <p>
025 * Authorizer provides user based authorization
026 * </p>
027 *
028 * <p>
029 * The document authorizer is associated with a document type through its data dictionary
030 * {@link org.kuali.rice.krad.datadictionary.DocumentEntry}. This is then used by the framework to authorize certain
031 * actions and in addition used for view presentation logic
032 * </p>
033 *
034 * @author Kuali Rice Team (rice.collab@kuali.org)
035 */
036 public interface DocumentAuthorizer extends DataObjectAuthorizer {
037 /**
038 * Checks if a user has the permissions to initiate a document
039 *
040 * @param documentTypeName, user
041 * @return boolean, true if the user has the permissions to initiate a document else false
042 */
043
044 public boolean canInitiate(String documentTypeName, Person user);
045
046 /**
047 * Checks if a user has the permissions to open a document
048 *
049 * @param document, user
050 * @return boolean, true if the user has the permissions to open a document else false
051 */
052
053 public boolean canOpen(Document document, Person user);
054
055 /**
056 * Determines if the document can be edited; if false is returned, then all fields are in a
057 * read only state
058 *
059 * @param document, user
060 * @return boolean, true if the user has the permissions to edit a document else false
061 */
062
063 public boolean canEdit(Document document, Person user);
064
065 public boolean canAnnotate(Document document, Person user);
066
067 public boolean canReload(Document document, Person user);
068
069 public boolean canClose(Document document, Person user);
070
071 public boolean canSave(Document document, Person user);
072
073 /**
074 * Determines if the user has permission to route the document
075 *
076 * @param document, user
077 * @return boolean, true if the user has permissions to route a document else false
078 */
079 public boolean canRoute(Document document, Person user);
080
081 /**
082 * Determines if the user has permission to cancel the document
083 *
084 * @param document, user
085 * @return boolean, true if the user has permissions to cancel a document else false
086 */
087 public boolean canCancel(Document document, Person user);
088
089 /**
090 * Determines if the user has permission to copy the document
091 *
092 * @param document, user
093 * @return boolean, true if the user has permissions to cancel a document else false
094 */
095 public boolean canCopy(Document document, Person user);
096
097 public boolean canPerformRouteReport(Document document, Person user);
098
099 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 }