View Javadoc

1   /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.student.common.ui.client.service;
17  
18  import java.util.ArrayList;
19  import java.util.HashMap;
20  
21  import org.kuali.rice.kim.bo.types.dto.AttributeSet;
22  import org.kuali.student.common.rice.authorization.PermissionType;
23  import org.kuali.student.common.ui.client.service.exceptions.OperationFailedException;
24  
25  import com.google.gwt.user.client.rpc.RemoteService;
26  import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
27  
28  /**
29   * 
30   * @author Kuali Student Team
31   * 
32   */
33  @RemoteServiceRelativePath("rpcservices/SecurityRpcService")
34  public interface SecurityRpcService extends RemoteService {
35  
36  	public String getPrincipalUsername();
37  
38  	/**
39  	 * This is used to check if the user has screen access based on a screen permission. 
40  	 * 
41  	 * @param screenName
42  	 * @return true if user has permission
43  	 * @throws OperationFailedException
44  	 */
45  	public Boolean hasScreenPermission(String screenName) throws OperationFailedException;
46  	
47  	
48  	/**
49  	 * Given a list of screen components, returns if user has permission for that screen element.
50  	 * 
51  	 * @param screens
52  	 * @return
53  	 * @throws OperationFailedException
54  	 */
55  	public HashMap<String,Boolean> getScreenPermissions(ArrayList<String> screens) throws OperationFailedException; 
56  	
57  	/**
58  	 * Given a list of permission names returns the list of permissions and if the 
59  	 * @param permissionNames
60  	 * @return
61  	 * @throws OperationFailedException
62  	 */
63  	public HashMap<String,Boolean> getPermissions(ArrayList<String> permissionNames) throws OperationFailedException;
64  	
65  	/**
66  	 * This is used to check if the user has a specific permission by the permission name
67  	 * 
68  	 * @param permissionName
69  	 * @return true if user has the permission.
70  	 */
71  	public Boolean hasPermissionByPermissionName(String permissionName) throws OperationFailedException;
72  	
73  	/**
74  	 * This is used to get all permissions assigned to the user based on a permission template.
75  	 * 
76  	 * @param templateName
77  	 * @return list of permission names
78  	 */
79  	public ArrayList<String> getPermissionsByType(PermissionType permissionType) throws OperationFailedException;
80  
81  	/**
82  	 * This is used to get all permissions assigned to the user based on a permission template.
83  	 * 
84  	 * @param permissionType
85  	 * @param attributes
86  	 * @return list of permission names
87  	 * @throws OperationFailedException
88  	 */
89  	public ArrayList<String> getPermissionsByType(PermissionType permissionType, HashMap<String, String> attributes) throws OperationFailedException;
90  }