Coverage Report - org.kuali.rice.kim.impl.permission.UberPermissionBo
 
Classes in this File Line Coverage Branch Coverage Complexity
UberPermissionBo
0%
0/11
0%
0/4
0
 
 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.kim.impl.permission
 17  
 
 18  
 
 19  
 
 20  
 import org.apache.commons.lang.StringUtils
 21  
 import org.kuali.rice.kim.api.KimConstants
 22  
 import org.kuali.rice.kim.api.identity.Person
 23  
 import org.kuali.rice.kim.impl.group.GroupBo
 24  
 import org.kuali.rice.kim.impl.role.RoleBo
 25  
 import org.springframework.util.AutoPopulatingList
 26  
 import org.kuali.rice.kim.api.permission.Permission
 27  
 
 28  
 //strange - hacky non-PBO
 29  
 class UberPermissionBo extends PermissionBo {
 30  
 
 31  
     private static final long serialVersionUID = 1L
 32  
 
 33  0
     List<RoleBo> assignedToRoles = new AutoPopulatingList(RoleBo.class)
 34  
     String assignedToRoleNamespaceForLookup
 35  
     String assignedToRoleNameForLookup
 36  
     RoleBo assignedToRole
 37  
     String assignedToPrincipalNameForLookup
 38  
     Person assignedToPrincipal
 39  
     String assignedToGroupNamespaceForLookup
 40  
     String assignedToGroupNameForLookup
 41  
     GroupBo assignedToGroup
 42  
     String attributeName
 43  
     String attributeValue
 44  
     String detailCriteria
 45  
 
 46  
     public static UberPermissionBo from(PermissionBo bo) {
 47  0
         if (bo == null) {
 48  0
             return null
 49  
         }
 50  0
         Permission.Builder builder =  Permission.Builder.create(bo)
 51  0
         return (UberPermissionBo) PermissionBo.from(builder.build())
 52  
 
 53  
     }
 54  
     public String getAssignedToRolesToDisplay() {
 55  0
         StringBuffer assignedToRolesText = new StringBuffer()
 56  0
         for (RoleBo roleImpl: assignedToRoles) {
 57  0
             assignedToRolesText.append(roleImpl.namespaceCode.trim()
 58  0
                     + " "
 59  0
                     + roleImpl.name.trim()
 60  
                     + KimConstants.KimUIConstants.COMMA_SEPARATOR)
 61  
         }
 62  0
         return StringUtils.chomp(assignedToRolesText.toString(), KimConstants.KimUIConstants.COMMA_SEPARATOR)
 63  
     }
 64  
 
 65  
     /*String getRoleDetailsToDisplay(RoleBo roleImpl) {
 66  
         String value = roleImpl.namespaceCode.trim() + " " + roleImpl.name.trim() + KimConstants.KimUIConstants.COMMA_SEPARATOR
 67  
         return value;
 68  
     }*/
 69  
 }
 70