1 /* 2 * The Kuali Financial System, a comprehensive financial management system for higher education. 3 * 4 * Copyright 2005-2014 The Kuali Foundation 5 * 6 * This program is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU Affero General Public License as 8 * published by the Free Software Foundation, either version 3 of the 9 * License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU Affero General Public License for more details. 15 * 16 * You should have received a copy of the GNU Affero General Public License 17 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 package org.kuali.rice.kim.impl.jaxb; 20 21 import javax.xml.bind.annotation.XmlAccessType; 22 import javax.xml.bind.annotation.XmlAccessorType; 23 import javax.xml.bind.annotation.XmlElement; 24 import javax.xml.bind.annotation.XmlType; 25 26 /** 27 * This class represents the <permissionData> element. 28 * 29 * <p>The expected XML structure is as follows: 30 * 31 * <br> 32 * <br><permissionData> 33 * <br> <permissions> 34 * <br> <permission> 35 * <br> <permissionName namespaceCode=""></permissionName> 36 * <br> <templateName namespaceCode=""></templateName> 37 * <br> <description></description> 38 * <br> <active></active> 39 * <br> <permissionDetails> 40 * <br> <permissionDetail key=""></permissionDetail> 41 * <br> </permissionDetails> 42 * <br> </permission> 43 * <br> </permissions> 44 * <br></permissionData> 45 * 46 * <p>Note the following: 47 * <ul> 48 * <li>The <permissions> element is optional, and can contain zero or more <permission> elements. 49 * <li>The <permissionName> element and its "namespaceCode" attribute are both required. 50 * The namespace code must map to a valid namespace. 51 * If the name and namespace combo matches an existing permission, then the permission in the XML 52 * will overwrite the existing permission. 53 * <li>The <templateName> element and its "namespaceCode" attribute are both required. 54 * The name and namespace combo on this element must match a valid permission template. 55 * <li>The <description> element is required, and must be non-blank. 56 * <li>The <active> element is optional, and will be set to true if not specified. 57 * <li>The <permissionDetails> element is optional, and can contain zero or more 58 * <permissionDetail> elements. 59 * <li>The <permissionDetail> element's "key" attribute is required, and must be non-blank. 60 * Duplicate keys within a <permissionDetails> element are not permitted. 61 * <li>The same permission can be ingested multiple times in the same file, where subsequent ones will 62 * overwrite previous ones. (TODO: Is this acceptable?) 63 * </ul> 64 * 65 * TODO: Verify that the above behavior is correct. 66 * 67 * @author Kuali Rice Team (rice.collab@kuali.org) 68 */ 69 @XmlAccessorType(XmlAccessType.FIELD) 70 @XmlType(name="PermissionDataType", propOrder={"permissions"}) 71 public class PermissionDataXmlDTO { 72 73 @XmlElement(name="permissions") 74 private PermissionsXmlDTO permissions; 75 76 public PermissionDataXmlDTO() {} 77 78 public PermissionDataXmlDTO(PermissionsXmlDTO permissions) { 79 this.permissions = permissions; 80 } 81 82 /** 83 * @return the permissions 84 */ 85 public PermissionsXmlDTO getPermissions() { 86 return this.permissions; 87 } 88 89 /** 90 * @param permissions the permissions to set 91 */ 92 public void setPermissions(PermissionsXmlDTO permissions) { 93 this.permissions = permissions; 94 } 95 }