1 /* 2 * Copyright 2010 The Kuali Foundation. 3 * 4 * Licensed under the Educational Community License, Version 1.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/ecl1.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.ole.sec.document.authorization; 17 18 import java.util.Set; 19 20 import org.kuali.ole.sec.SecPropertyConstants; 21 import org.kuali.ole.sys.OLEPropertyConstants; 22 import org.kuali.rice.kns.document.authorization.MaintenanceDocumentPresentationControllerBase; 23 24 25 /** 26 * Presentation controller for the security definition maintenance document, sets conditional read only fields 27 */ 28 public class SecurityDefinitionMaintenanceDocumentPresentationController extends MaintenanceDocumentPresentationControllerBase { 29 30 31 /** 32 * Don't allow editing of definition name on edit 33 * 34 * @see org.kuali.rice.krad.document.authorization.MaintenanceDocumentPresentationControllerBase#getConditionallyReadOnlyPropertyNames(org.kuali.rice.kns.document.MaintenanceDocument) 35 */ 36 @Override 37 public Set<String> getConditionallyReadOnlyPropertyNames(org.kuali.rice.kns.document.MaintenanceDocument document) { 38 Set<String> readOnlyFields = super.getConditionallyReadOnlyPropertyNames(document); 39 40 if (!document.isNew()) { 41 readOnlyFields.add(OLEPropertyConstants.NAME); 42 readOnlyFields.add(SecPropertyConstants.SECURITY_ATTRIBUTE_NAME_NESTED); 43 } 44 45 return readOnlyFields; 46 } 47 48 }