001    /*
002     * Copyright 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.kfs.sec.service;
017    
018    import java.util.Map;
019    
020    import org.kuali.rice.kim.bo.Person;
021    
022    /**
023     * AccessPermissionEvaluator classes provide the evaluation of a given security permission. Methods are exposed for setting the user's qualification for a permission and method
024     * exposed to pass a value and perform the evaluation
025     */
026    public interface AccessPermissionEvaluator {
027    
028        /**
029         * Evaluates the given value against the permission definition. How the evaluation is carried out depends on implementation
030         * 
031         * @param value String value to evaluate
032         * @return True if value is allowed based on the permission definition or false if it is not allowed
033         */
034        public boolean valueIsAllowed(String value);
035    
036        /**
037         * Setter for the constraint code found on the user's qualification record
038         * 
039         * @param constraintCode
040         */
041        public void setConstraintCode(String constraintCode);
042    
043        /**
044         * Setter for the operator code found on the user's qualification record
045         * 
046         * @param operatorCode
047         */
048        public void setOperatorCode(String operatorCode);
049    
050        /**
051         * Setter for the property value found on the user's qualification record
052         * 
053         * @param propertyValue
054         */
055        public void setPropertyValue(String propertyValue);
056    
057        /**
058         * Setter for the Map that holds values for the other key fields (if any)
059         * 
060         * @param otherKeyFieldValues Map with field name as the Map key and field value as Map value
061         */
062        public void setOtherKeyFieldValueMap(Map<String, Object> otherKeyFieldValues);
063    
064        /**
065         * Setter for the person who the permission is being evaluated for
066         * 
067         * @param person Person kim business object
068         */
069        public void setPerson(Person person);
070    
071    }