1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.apache.struts2.interceptor;
23
24 import java.security.Principal;
25
26 import javax.servlet.http.HttpServletRequest;
27
28 /***
29 * Proxy interface used together with PrincipalAware interface. It allows indirect
30 * access to HttpServletRequest or PortletRequest Principal related methods.
31 */
32 public interface PrincipalProxy {
33
34 /***
35 * True if the user is in the given role
36 *
37 * @param role The role
38 * @return True if the user is in that role
39 */
40 boolean isUserInRole(String role);
41
42 /***
43 * Gets the user principal
44 *
45 * @return The principal
46 */
47 Principal getUserPrincipal();
48
49 /***
50 * Gets the user id
51 *
52 * @return The user id
53 */
54 String getRemoteUser();
55
56 /***
57 * Is the request using https?
58 *
59 * @return True if using https
60 */
61 boolean isRequestSecure();
62
63 /***
64 * Gets the request.
65 *
66 * @return The request
67 * @deprecated To obtain the HttpServletRequest in your action, use
68 * {@link org.apache.struts2.servlet.ServletRequestAware}, since this method will be dropped in future.
69 */
70 HttpServletRequest getRequest();
71 }