001 /**
002 * Copyright 2010 The Kuali Foundation Licensed under the
003 * Educational Community License, Version 2.0 (the "License"); you may
004 * not use this file except in compliance with the License. You may
005 * obtain a copy of the License at
006 *
007 * http://www.osedu.org/licenses/ECL-2.0
008 *
009 * Unless required by applicable law or agreed to in writing,
010 * software distributed under the License is distributed on an "AS IS"
011 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
012 * or implied. See the License for the specific language governing
013 * permissions and limitations under the License.
014 */
015
016 package org.kuali.student.common.ui.client.service;
017
018 import java.util.ArrayList;
019 import java.util.HashMap;
020
021 import org.kuali.rice.kim.bo.types.dto.AttributeSet;
022 import org.kuali.student.common.rice.authorization.PermissionType;
023 import org.kuali.student.common.ui.client.service.exceptions.OperationFailedException;
024
025 import com.google.gwt.user.client.rpc.RemoteService;
026 import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
027
028 /**
029 *
030 * @author Kuali Student Team
031 *
032 */
033 @RemoteServiceRelativePath("rpcservices/SecurityRpcService")
034 public interface SecurityRpcService extends RemoteService {
035
036 public String getPrincipalUsername();
037
038 /**
039 * This is used to check if the user has screen access based on a screen permission.
040 *
041 * @param screenName
042 * @return true if user has permission
043 * @throws OperationFailedException
044 */
045 public Boolean hasScreenPermission(String screenName) throws OperationFailedException;
046
047
048 /**
049 * Given a list of screen components, returns if user has permission for that screen element.
050 *
051 * @param screens
052 * @return
053 * @throws OperationFailedException
054 */
055 public HashMap<String,Boolean> getScreenPermissions(ArrayList<String> screens) throws OperationFailedException;
056
057 /**
058 * Given a list of permission names returns the list of permissions and if the
059 * @param permissionNames
060 * @return
061 * @throws OperationFailedException
062 */
063 public HashMap<String,Boolean> getPermissions(ArrayList<String> permissionNames) throws OperationFailedException;
064
065 /**
066 * This is used to check if the user has a specific permission by the permission name
067 *
068 * @param permissionName
069 * @return true if user has the permission.
070 */
071 public Boolean hasPermissionByPermissionName(String permissionName) throws OperationFailedException;
072
073 /**
074 * This is used to get all permissions assigned to the user based on a permission template.
075 *
076 * @param templateName
077 * @return list of permission names
078 */
079 public ArrayList<String> getPermissionsByType(PermissionType permissionType) throws OperationFailedException;
080
081 /**
082 * This is used to get all permissions assigned to the user based on a permission template.
083 *
084 * @param permissionType
085 * @param attributes
086 * @return list of permission names
087 * @throws OperationFailedException
088 */
089 public ArrayList<String> getPermissionsByType(PermissionType permissionType, HashMap<String, String> attributes) throws OperationFailedException;
090 }