| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| DocumentTypePermissionService |
|
| 1.0;1 |
| 1 | /** | |
| 2 | * Copyright 2005-2011 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.kew.doctype.service; | |
| 17 | ||
| 18 | import org.kuali.rice.kew.doctype.bo.DocumentType; | |
| 19 | import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; | |
| 20 | ||
| 21 | import java.util.List; | |
| 22 | ||
| 23 | /** | |
| 24 | * Implements permission checks related to Document Type. In general, | |
| 25 | * these permission checks are invoked from the various actions | |
| 26 | * which require authorization. | |
| 27 | * | |
| 28 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 29 | */ | |
| 30 | public interface DocumentTypePermissionService { | |
| 31 | ||
| 32 | /** | |
| 33 | * Determines if the given principal is authorized to receive ad hoc requests | |
| 34 | * for the given DocumentType and action request type. | |
| 35 | */ | |
| 36 | boolean canReceiveAdHocRequest(String principalId, DocumentType documentType, String actionRequestCode); | |
| 37 | ||
| 38 | /** | |
| 39 | * Determines if the given group is authorized to receive ad hoc requests of the | |
| 40 | * specified action request code for the given DocumentType and action request type. | |
| 41 | * A group is considered to be authorized to receive an ad hoc request if all | |
| 42 | * of it's members can receive the request. | |
| 43 | */ | |
| 44 | boolean canGroupReceiveAdHocRequest(String groupId, DocumentType documentType, String actionRequestCode); | |
| 45 | ||
| 46 | /** | |
| 47 | * Determines if the given principal can administer routing for the given | |
| 48 | * DocumentType. Having this permission gives them "super user" capabilities. | |
| 49 | */ | |
| 50 | boolean canAdministerRouting(String principalId, DocumentType documentType); | |
| 51 | ||
| 52 | /** | |
| 53 | * Determines if the given principal can initiate documents of the given DocumentType. | |
| 54 | */ | |
| 55 | boolean canInitiate(String principalId, DocumentType documentType); | |
| 56 | ||
| 57 | /** | |
| 58 | * Determines if the given principal can route documents of the given DocumentRouteHeaderValue. The permission check | |
| 59 | * also considers the document status and initiator of the document. | |
| 60 | */ | |
| 61 | boolean canRoute(String principalId, DocumentRouteHeaderValue documentRouteHeaderValue); | |
| 62 | ||
| 63 | /** | |
| 64 | * Determines if the given principal can save documents of the given DocumentType. The permission check | |
| 65 | * also considers the document's current route nodes, document status, and initiator of the document. | |
| 66 | * | |
| 67 | * <p>It is intended the only one of the given route nodes will need to satisfy the permission check. | |
| 68 | * For example, if the save permission is defined for node 1 but not for node 2, then a document which | |
| 69 | * is at both node 1 and node 2 should satisfy the permission check. | |
| 70 | */ | |
| 71 | boolean canSave(String principalId, String documentId, DocumentType documentType, List<String> routeNodeNames, String documentStatus, String initiatorPrincipalId); | |
| 72 | ||
| 73 | /** | |
| 74 | * Determines if the given principal can blanket approve documents of the given DocumentType. The permission check | |
| 75 | * also considers the document status and the initiator of the document. | |
| 76 | */ | |
| 77 | boolean canBlanketApprove(String principalId, DocumentType documentType, String documentStatus, String initiatorPrincipalId); | |
| 78 | ||
| 79 | /** | |
| 80 | * Determines if the given principal can cancel documents of the given DocumentType. The permission check | |
| 81 | * also considers the document's current route nodes, document status, and initiator of the document. | |
| 82 | * | |
| 83 | * <p>It is intended the only one of the given route nodes will need to satisfy the permission check. | |
| 84 | * For example, if the cancel permission is defined for node 1 but not for node 2, then a document which | |
| 85 | * is at both node 1 and node 2 should satisfy the permission check. | |
| 86 | */ | |
| 87 | boolean canCancel(String principalId, String documentId, DocumentType documentType, List<String> routeNodeNames, String documentStatus, String initiatorPrincipalId); | |
| 88 | ||
| 89 | /** | |
| 90 | * Determines if the given principal can add route log messages for documents of the given DocumentRouteHeaderValue. The permission check | |
| 91 | * also considers the document status and initiator of the document. | |
| 92 | */ | |
| 93 | boolean canAddRouteLogMessage(String principalId, DocumentRouteHeaderValue documentRouteHeaderValue); | |
| 94 | ||
| 95 | } |