Class ServletPrincipalProxy
java.lang.Object
org.apache.struts2.interceptor.servlet.ServletPrincipalProxy
- All Implemented Interfaces:
PrincipalProxy
PrincipalProxy implementation for using HttpServletRequest Principal related methods.
-
Constructor Summary
ConstructorsConstructorDescriptionServletPrincipalProxy
(jakarta.servlet.http.HttpServletRequest request) Constructs a proxy -
Method Summary
Modifier and TypeMethodDescriptionGets the user idGets the user principalboolean
Is the request using https?boolean
isUserInRole
(String role) True if the user is in the given role
-
Constructor Details
-
ServletPrincipalProxy
public ServletPrincipalProxy(jakarta.servlet.http.HttpServletRequest request) Constructs a proxy- Parameters:
request
- The underlying request
-
-
Method Details
-
isUserInRole
True if the user is in the given role- Specified by:
isUserInRole
in interfacePrincipalProxy
- Parameters:
role
- The role- Returns:
- True if the user is in that role
-
getUserPrincipal
Gets the user principal- Specified by:
getUserPrincipal
in interfacePrincipalProxy
- Returns:
- The principal
-
getRemoteUser
Gets the user id- Specified by:
getRemoteUser
in interfacePrincipalProxy
- Returns:
- The user id
-
isRequestSecure
public boolean isRequestSecure()Is the request using https?- Specified by:
isRequestSecure
in interfacePrincipalProxy
- Returns:
- True if using https
-