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