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