001    /**
002     * Copyright 2005-2011 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.rice.kim.api.permission;
017    
018    
019    import org.kuali.rice.core.api.mo.common.GloballyUnique;
020    import org.kuali.rice.core.api.mo.common.Identifiable;
021    import org.kuali.rice.core.api.mo.common.Versioned;
022    import org.kuali.rice.core.api.mo.common.active.Inactivatable;
023    import org.kuali.rice.kim.api.common.template.TemplateContract;
024    
025    import java.util.Map;
026    
027    /**
028     * This is the contract for a Permission. Represents a single permission within the system.
029     * 
030     * Permissions are attached to roles. All authorization checks should be done against permissions,
031     * never against roles or groups.
032     *  
033     */
034    public interface PermissionContract extends Versioned, GloballyUnique, Inactivatable, Identifiable {
035        
036        /**
037         * The namespace code that this Permission belongs too.
038         *
039         * @return namespaceCode
040         */
041        String getNamespaceCode();
042        
043        /**
044         * The name of the Permission.
045         *
046         * @return name
047         */
048        String getName();
049        
050        /**
051         * The description of the Permission.
052         *
053         * @return description
054         */
055            String getDescription();
056    
057        /**
058         * The Template referenced by the Permission.
059         *
060         * @return templateId
061         */
062            TemplateContract getTemplate();
063            
064       /** 
065             * Attributes for a Permission.
066             * 
067             * @return attributes
068             */
069        Map<String, String> getAttributes();
070    }