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