/*
* The Kuali Financial System, a comprehensive financial management system for higher education.
*
* Copyright 2005-2014 The Kuali Foundation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.kuali.rice.kim.impl.jaxb;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* This class represents the <permissionData> element.
*
* <p>The expected XML structure is as follows:
*
* <br>
* <br><permissionData>
* <br> <permissions>
* <br> <permission>
* <br> <permissionName namespaceCode=""></permissionName>
* <br> <templateName namespaceCode=""></templateName>
* <br> <description></description>
* <br> <active></active>
* <br> <permissionDetails>
* <br> <permissionDetail key=""></permissionDetail>
* <br> </permissionDetails>
* <br> </permission>
* <br> </permissions>
* <br></permissionData>
*
* <p>Note the following:
* <ul>
* <li>The <permissions> element is optional, and can contain zero or more <permission> elements.
* <li>The <permissionName> element and its "namespaceCode" attribute are both required.
* The namespace code must map to a valid namespace.
* If the name and namespace combo matches an existing permission, then the permission in the XML
* will overwrite the existing permission.
* <li>The <templateName> element and its "namespaceCode" attribute are both required.
* The name and namespace combo on this element must match a valid permission template.
* <li>The <description> element is required, and must be non-blank.
* <li>The <active> element is optional, and will be set to true if not specified.
* <li>The <permissionDetails> element is optional, and can contain zero or more
* <permissionDetail> elements.
* <li>The <permissionDetail> element's "key" attribute is required, and must be non-blank.
* Duplicate keys within a <permissionDetails> element are not permitted.
* <li>The same permission can be ingested multiple times in the same file, where subsequent ones will
* overwrite previous ones. (TODO: Is this acceptable?)
* </ul>
*
* TODO: Verify that the above behavior is correct.
*
* @author Kuali Rice Team (rice.collab@kuali.org)
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name="PermissionDataType", propOrder={"permissions"})
public class PermissionDataXmlDTO {
@XmlElement(name="permissions")
private PermissionsXmlDTO permissions;
public PermissionDataXmlDTO() {}
public PermissionDataXmlDTO(PermissionsXmlDTO permissions) {
this.permissions = permissions;
}
/**
* @return the permissions
*/
public PermissionsXmlDTO getPermissions() {
return this.permissions;
}
/**
* @param permissions the permissions to set
*/
public void setPermissions(PermissionsXmlDTO permissions) {
this.permissions = permissions;
}
}