Coverage Report - org.kuali.rice.krms.impl.authorization.AgendaEditorAuthorizer
 
Classes in this File Line Coverage Branch Coverage Complexity
AgendaEditorAuthorizer
0%
0/9
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.krms.impl.authorization;
 17  
 
 18  
 import org.kuali.rice.kim.api.identity.Person;
 19  
 import org.kuali.rice.krad.document.MaintenanceDocument;
 20  
 import org.kuali.rice.krad.document.authorization.MaintenanceDocumentAuthorizer;
 21  
 import org.kuali.rice.krad.document.authorization.DocumentAuthorizerBase;
 22  
 import org.kuali.rice.krms.api.KrmsConstants;
 23  
 import org.kuali.rice.krms.impl.repository.AgendaBo;
 24  
 import org.kuali.rice.krms.impl.repository.KrmsRepositoryServiceLocator;
 25  
 import org.kuali.rice.krms.impl.ui.AgendaEditor;
 26  
 
 27  
 import java.util.HashSet;
 28  
 import java.util.Set;
 29  
 
 30  0
 public class AgendaEditorAuthorizer extends DocumentAuthorizerBase implements MaintenanceDocumentAuthorizer {
 31  
 
 32  
     @Override
 33  
     public boolean canCreate(Class boClass, Person user) {
 34  0
         return getAgendaAuthorizationService().isAuthorized(KrmsConstants.MAINTAIN_KRMS_AGENDA, null);
 35  
     }
 36  
 
 37  
     @Override
 38  
     public boolean canMaintain(Object dataObject, Person user) {
 39  0
         AgendaEditor agendaEditor = (AgendaEditor) dataObject;
 40  0
         return getAgendaAuthorizationService().isAuthorized(KrmsConstants.MAINTAIN_KRMS_AGENDA, agendaEditor.getAgenda().getContextId());
 41  
     }
 42  
 
 43  
     @Override
 44  
     public boolean canCreateOrMaintain(MaintenanceDocument maintenanceDocument, Person user) {
 45  0
         AgendaEditor agendaEditor = (AgendaEditor) maintenanceDocument.getOldMaintainableObject().getDataObject();
 46  0
         return getAgendaAuthorizationService().isAuthorized(KrmsConstants.MAINTAIN_KRMS_AGENDA, agendaEditor.getAgenda().getContextId());
 47  
     }
 48  
 
 49  
     @Override
 50  
     public Set<String> getSecurePotentiallyReadOnlySectionIds() {
 51  0
         return new HashSet<String>();
 52  
     }
 53  
 
 54  
     @Override
 55  
     public Set<String> getSecurePotentiallyHiddenSectionIds() {
 56  0
         return new HashSet<String>();
 57  
     }
 58  
 
 59  
     private AgendaAuthorizationService getAgendaAuthorizationService() {
 60  0
         return KrmsRepositoryServiceLocator.getAgendaAuthorizationService();
 61  
     }
 62  
 }