Coverage Report - org.kuali.rice.krad.service.impl.DocumentTypeAndEditModePermissionTypeServiceImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
DocumentTypeAndEditModePermissionTypeServiceImpl
0%
0/10
0%
0/4
3
 
 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.krad.service.impl;
 17  
 
 18  
 
 19  
 import org.kuali.rice.kim.api.permission.Permission;
 20  
 import org.kuali.rice.kim.impl.permission.PermissionBo;
 21  
 import org.kuali.rice.kim.util.KimConstants;
 22  
 
 23  
 import java.util.ArrayList;
 24  
 import java.util.List;
 25  
 import java.util.Map;
 26  
 
 27  
 /**
 28  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 29  
  */
 30  0
 public class DocumentTypeAndEditModePermissionTypeServiceImpl extends DocumentTypePermissionTypeServiceImpl {
 31  
         
 32  
         {
 33  0
                 requiredAttributes.add(KimConstants.AttributeConstants.EDIT_MODE);
 34  0
         }
 35  
         
 36  
         @Override
 37  
         protected List<Permission> performPermissionMatches(
 38  
                         Map<String, String> requestedDetails,
 39  
                         List<Permission> permissionsList) {
 40  0
                 List<Permission> matchingPermissions = new ArrayList<Permission>();
 41  0
                 for (Permission permission : permissionsList) {
 42  0
             PermissionBo bo = PermissionBo.from(permission);
 43  0
                         if (requestedDetails.get(KimConstants.AttributeConstants.EDIT_MODE).equals(bo.getDetails().get(KimConstants.AttributeConstants.EDIT_MODE))) {
 44  0
                                 matchingPermissions.add(permission);
 45  
                         }
 46  0
                 }
 47  0
                 return super.performPermissionMatches(requestedDetails, matchingPermissions);
 48  
         }
 49  
 }