Coverage Report - org.kuali.rice.kew.doctype.SecuritySession
 
Classes in this File Line Coverage Branch Coverage Complexity
SecuritySession
0%
0/24
N/A
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;
 17  
 
 18  
 import java.io.Serializable;
 19  
 import java.util.HashMap;
 20  
 import java.util.Map;
 21  
 
 22  
 import org.kuali.rice.kew.api.extension.ExtensionDefinition;
 23  
 import org.kuali.rice.kew.framework.document.security.DocumentSecurityAttribute;
 24  
 
 25  
 /**
 26  
  * Caches information about various security constraints for a single user which have already been
 27  
  * analyzed and don't need to be analyzed again.  For example, once it's been determined that
 28  
  * a user is a member of a workgroup or a role, it is not necessary to requery the
 29  
  * workgroup or role for information on whether that user is a member.
 30  
  *
 31  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 32  
  */
 33  
 public class SecuritySession implements Serializable {
 34  
 
 35  
         private static final long serialVersionUID = 2542191040889845305L;
 36  
 
 37  
         private final String principalId;
 38  0
         private Map<String, Boolean> authenticatedWorkgroups = new HashMap<String, Boolean>();
 39  0
         private Map<String, Boolean> passesRoleSecurity = new HashMap<String, Boolean>();
 40  0
     private Map<String, DocumentSecurityAttribute> securityAttributeClassNameMap = new HashMap<String, DocumentSecurityAttribute>();
 41  0
     private Map<String, ExtensionDefinition> extensionDefinitionMap = new HashMap<String, ExtensionDefinition>();
 42  
 
 43  0
         private Map<String, DocumentTypeSecurity> documentTypeSecurity = new HashMap<String, DocumentTypeSecurity>();
 44  
 
 45  0
         public SecuritySession(String principalId) {
 46  0
                 this.principalId = principalId;
 47  0
         }
 48  
 
 49  
         public String getPrincipalId() {
 50  0
                 return principalId;
 51  
         }
 52  
 
 53  
         public Map<String, Boolean> getPassesRoleSecurity() {
 54  0
                 return passesRoleSecurity;
 55  
         }
 56  
 
 57  
         public void setPassesRoleSecurity(Map<String, Boolean> passesRoleSecurity) {
 58  0
                 this.passesRoleSecurity = passesRoleSecurity;
 59  0
         }
 60  
 
 61  
         public Map<String, Boolean> getAuthenticatedWorkgroups() {
 62  0
                 return authenticatedWorkgroups;
 63  
         }
 64  
 
 65  
         public void setAuthenticatedWorkgroups(Map<String, Boolean> authenticatedWorkgroups) {
 66  0
                 this.authenticatedWorkgroups = authenticatedWorkgroups;
 67  0
         }
 68  
 
 69  
         public Map<String, DocumentTypeSecurity> getDocumentTypeSecurity() {
 70  0
                 return documentTypeSecurity;
 71  
         }
 72  
 
 73  
         public void setDocumentTypeSecurity(Map<String, DocumentTypeSecurity> documentTypeSecurity) {
 74  0
                 this.documentTypeSecurity = documentTypeSecurity;
 75  0
         }
 76  
 
 77  
     public DocumentSecurityAttribute getSecurityAttributeForClass(String className) {
 78  0
         return this.securityAttributeClassNameMap.get(className);
 79  
     }
 80  
 
 81  
     public void setSecurityAttributeForClass(String className, DocumentSecurityAttribute securityAttribute) {
 82  0
         this.securityAttributeClassNameMap.put(className, securityAttribute);
 83  0
     }
 84  
 
 85  
     public ExtensionDefinition getExtensionByName(String extensionName) {
 86  0
         return extensionDefinitionMap.get(extensionName);
 87  
     }
 88  
 
 89  
     public void setExtensionForName(String extensionName, ExtensionDefinition extension) {
 90  0
         this.extensionDefinitionMap.put(extensionName, extension);
 91  0
     }
 92  
 }