Coverage Report - org.kuali.rice.kns.service.impl.DocumentTypeAndRelationshipToNoteAuthorPermissionTypeService
 
Classes in this File Line Coverage Branch Coverage Complexity
DocumentTypeAndRelationshipToNoteAuthorPermissionTypeService
0%
0/12
0%
0/10
7
 
 1  
 /*
 2  
  * Copyright 2007-2009 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.kns.service.impl;
 17  
 
 18  
 import java.util.ArrayList;
 19  
 import java.util.List;
 20  
 
 21  
 import org.kuali.rice.core.util.AttributeSet;
 22  
 import org.kuali.rice.kim.bo.role.dto.KimPermissionInfo;
 23  
 import org.kuali.rice.kim.util.KimConstants;
 24  
 
 25  
 /**
 26  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 27  
  */
 28  0
 public class DocumentTypeAndRelationshipToNoteAuthorPermissionTypeService
 29  
                 extends DocumentTypePermissionTypeServiceImpl {
 30  
 
 31  
         @Override
 32  
         protected List<KimPermissionInfo> performPermissionMatches(
 33  
                         AttributeSet requestedDetails,
 34  
                         List<KimPermissionInfo> permissionsList) {
 35  
                                 
 36  0
                 List<KimPermissionInfo> matchingPermissions = new ArrayList<KimPermissionInfo>();
 37  0
                 if (requestedDetails == null) {
 38  0
                         return matchingPermissions; // empty list
 39  
                 }
 40  
                 
 41  
                 // loop over the permissions, checking the non-document-related ones
 42  0
                 for (KimPermissionInfo kimPermissionInfo : permissionsList) {
 43  0
                         if (Boolean.parseBoolean(requestedDetails
 44  
                                         .get(KimConstants.AttributeConstants.CREATED_BY_SELF))) {
 45  0
                                 if(Boolean.parseBoolean(kimPermissionInfo.getDetails().get(
 46  
                                                 KimConstants.AttributeConstants.CREATED_BY_SELF_ONLY))){
 47  0
                                         matchingPermissions.add(kimPermissionInfo);
 48  
                                 }
 49  
                                 
 50  
                         }else{
 51  0
                                 if (!Boolean.parseBoolean(kimPermissionInfo.getDetails().get(
 52  
                                                 KimConstants.AttributeConstants.CREATED_BY_SELF_ONLY))) {
 53  0
                                         matchingPermissions.add(kimPermissionInfo);
 54  
                                 }
 55  
                         }
 56  
 
 57  
                 }
 58  
                 
 59  0
                 matchingPermissions = super.performPermissionMatches(requestedDetails, matchingPermissions);
 60  0
                 return matchingPermissions;
 61  
         }
 62  
 }