Class GenericServlet.ServletSecurityContext
java.lang.Object
org.deltava.servlet.GenericServlet.ServletSecurityContext
- All Implemented Interfaces:
SecurityContext
- Enclosing class:
GenericServlet
Security Context for use within servlets.
- Since:
- 1.0
- Version:
- 11.3
- Author:
- Luke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the current servlet request.getRoles()Returns all the roles for the currently authenticated user.getUser()Returns the currently authenticated user.booleanQueries if the current user is authenticated or anonymous.booleanisUserInRole(String roleName) Returns if the user is a member of a particular security role.
-
Constructor Details
-
ServletSecurityContext
-
-
Method Details
-
getUser
Description copied from interface:SecurityContextReturns the currently authenticated user.- Specified by:
getUserin interfaceSecurityContext- Returns:
- the user's Person object, or null if anonymous
-
isAuthenticated
public boolean isAuthenticated()Description copied from interface:SecurityContextQueries if the current user is authenticated or anonymous.- Specified by:
isAuthenticatedin interfaceSecurityContext- Returns:
- TRUE if a user is logged in, otherwise FALSE
-
getRoles
Description copied from interface:SecurityContextReturns all the roles for the currently authenticated user.- Specified by:
getRolesin interfaceSecurityContext- Returns:
- a Collection of role names, or an empty collection
-
isUserInRole
Description copied from interface:SecurityContextReturns if the user is a member of a particular security role.- Specified by:
isUserInRolein interfaceSecurityContext- Parameters:
roleName- the role name- Returns:
- TRUE if the user is a member of the role, otherwise FALSE
-
getRequest
Description copied from interface:SecurityContextReturns the current servlet request. Some access controllers may need to examine attributes within the servlet request.- Specified by:
getRequestin interfaceSecurityContext- Returns:
- the HTTP servlet request
-