1 /** 2 * Copyright 2005-2014 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.uif.container; 17 18 import org.kuali.rice.krad.datadictionary.parse.BeanTag; 19 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute; 20 import org.kuali.rice.krad.uif.component.ComponentSecurity; 21 22 /** 23 * Collection Group security is used to flag that permissions exist for the associated {@link CollectionGroup} 24 * in KIM and should be checked to determine the associated group, line, and field state. In particular this adds 25 * the edit line and view line flags 26 * 27 * <p> 28 * In addition, properties such as additional role and permission details can be configured to use when 29 * checking the KIM permissions 30 * </p> 31 * 32 * @author Kuali Rice Team (rice.collab@kuali.org) 33 */ 34 @BeanTag(name = "collectionGroupSecurity-bean") 35 public class CollectionGroupSecurity extends ComponentSecurity { 36 private static final long serialVersionUID = 1134455196763917062L; 37 38 private boolean editLineAuthz; 39 private boolean viewLineAuthz; 40 41 public CollectionGroupSecurity() { 42 super(); 43 44 editLineAuthz = false; 45 viewLineAuthz = false; 46 } 47 48 /** 49 * Indicates whether the collection group line has edit authorization and KIM should be consulted 50 * 51 * @return true if the line has edit authorization, false if not 52 */ 53 @BeanTagAttribute(name="editLineAuthz") 54 public boolean isEditLineAuthz() { 55 return editLineAuthz; 56 } 57 58 /** 59 * Setter for the edit line authorization flag 60 * 61 * @param editLineAuthz 62 */ 63 public void setEditLineAuthz(boolean editLineAuthz) { 64 this.editLineAuthz = editLineAuthz; 65 } 66 67 /** 68 * Indicates whether the collection group line has view authorization and KIM should be consulted 69 * 70 * @return true if the line has view authorization, false if not 71 */ 72 @BeanTagAttribute(name="viewLineAuthz") 73 public boolean isViewLineAuthz() { 74 return viewLineAuthz; 75 } 76 77 /** 78 * Setter for the view line authorization flag 79 * 80 * @param viewLineAuthz 81 */ 82 public void setViewLineAuthz(boolean viewLineAuthz) { 83 this.viewLineAuthz = viewLineAuthz; 84 } 85 86 /** 87 * @see org.kuali.rice.krad.uif.component.ComponentSecurity#copy() 88 */ 89 @Override 90 protected <T> void copyProperties(T componentSecurity) { 91 super.copyProperties(componentSecurity); 92 CollectionGroupSecurity collectionGroupSecurityCopy = (CollectionGroupSecurity) componentSecurity; 93 collectionGroupSecurityCopy.setEditLineAuthz(this.editLineAuthz); 94 collectionGroupSecurityCopy.setViewLineAuthz(this.viewLineAuthz); 95 } 96 }