001/*
002 * The Kuali Financial System, a comprehensive financial management system for higher education.
003 * 
004 * Copyright 2005-2014 The Kuali Foundation
005 * 
006 * This program is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU Affero General Public License as
008 * published by the Free Software Foundation, either version 3 of the
009 * License, or (at your option) any later version.
010 * 
011 * This program is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014 * GNU Affero General Public License for more details.
015 * 
016 * You should have received a copy of the GNU Affero General Public License
017 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
018 */
019package org.kuali.rice.kim.impl.jaxb;
020
021import javax.xml.bind.annotation.XmlAccessType;
022import javax.xml.bind.annotation.XmlAccessorType;
023import javax.xml.bind.annotation.XmlElement;
024import javax.xml.bind.annotation.XmlType;
025
026/**
027 * This class represents the &lt;permissionData&gt; element.
028 * 
029 * <p>The expected XML structure is as follows:
030 * 
031 * <br>
032 * <br>&lt;permissionData&gt;
033 * <br>&nbsp;&nbsp;&lt;permissions&gt;
034 * <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;permission&gt;
035 * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;permissionName namespaceCode=""&gt;&lt;/permissionName&gt;
036 * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;templateName namespaceCode=""&gt;&lt;/templateName&gt;
037 * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;&lt;/description&gt;
038 * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;active&gt;&lt;/active&gt;
039 * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;permissionDetails&gt;
040 * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;permissionDetail key=""&gt;&lt;/permissionDetail&gt;
041 * <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/permissionDetails&gt;
042 * <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/permission&gt;
043 * <br>&nbsp;&nbsp;&lt;/permissions&gt;
044 * <br>&lt;/permissionData&gt;
045 * 
046 * <p>Note the following:
047 * <ul>
048 *   <li>The &lt;permissions&gt; element is optional, and can contain zero or more &lt;permission&gt; elements.
049 *   <li>The &lt;permissionName&gt; element and its "namespaceCode" attribute are both required.
050 *   The namespace code must map to a valid namespace.
051 *   If the name and namespace combo matches an existing permission, then the permission in the XML
052 *   will overwrite the existing permission.
053 *   <li>The &lt;templateName&gt; element and its "namespaceCode" attribute are both required.
054 *   The name and namespace combo on this element must match a valid permission template.
055 *   <li>The &lt;description&gt; element is required, and must be non-blank.
056 *   <li>The &lt;active&gt; element is optional, and will be set to true if not specified.
057 *   <li>The &lt;permissionDetails&gt; element is optional, and can contain zero or more
058 *   &lt;permissionDetail&gt; elements.
059 *   <li>The &lt;permissionDetail&gt; element's "key" attribute is required, and must be non-blank.
060 *   Duplicate keys within a &lt;permissionDetails&gt; element are not permitted.
061 *   <li>The same permission can be ingested multiple times in the same file, where subsequent ones will
062 *   overwrite previous ones. (TODO: Is this acceptable?)
063 * </ul>
064 * 
065 * TODO: Verify that the above behavior is correct.
066 * 
067 * @author Kuali Rice Team (rice.collab@kuali.org)
068 */
069@XmlAccessorType(XmlAccessType.FIELD)
070@XmlType(name="PermissionDataType", propOrder={"permissions"})
071public class PermissionDataXmlDTO {
072
073    @XmlElement(name="permissions")
074    private PermissionsXmlDTO permissions;
075    
076    public PermissionDataXmlDTO() {}
077    
078    public PermissionDataXmlDTO(PermissionsXmlDTO permissions) {
079        this.permissions = permissions;
080    }
081
082    /**
083     * @return the permissions
084     */
085    public PermissionsXmlDTO getPermissions() {
086        return this.permissions;
087    }
088
089    /**
090     * @param permissions the permissions to set
091     */
092    public void setPermissions(PermissionsXmlDTO permissions) {
093        this.permissions = permissions;
094    }
095}