Class GenericServlet.ServletSecurityContext

java.lang.Object
org.deltava.servlet.GenericServlet.ServletSecurityContext
All Implemented Interfaces:
SecurityContext
Enclosing class:
GenericServlet

protected class GenericServlet.ServletSecurityContext extends Object implements SecurityContext
Security Context for use within servlets.
Since:
1.0
Version:
11.3
Author:
Luke
  • Constructor Details

  • Method Details

    • getUser

      public Pilot getUser()
      Description copied from interface: SecurityContext
      Returns the currently authenticated user.
      Specified by:
      getUser in interface SecurityContext
      Returns:
      the user's Person object, or null if anonymous
    • isAuthenticated

      public boolean isAuthenticated()
      Description copied from interface: SecurityContext
      Queries if the current user is authenticated or anonymous.
      Specified by:
      isAuthenticated in interface SecurityContext
      Returns:
      TRUE if a user is logged in, otherwise FALSE
    • getRoles

      public Collection<String> getRoles()
      Description copied from interface: SecurityContext
      Returns all the roles for the currently authenticated user.
      Specified by:
      getRoles in interface SecurityContext
      Returns:
      a Collection of role names, or an empty collection
    • isUserInRole

      public boolean isUserInRole(String roleName)
      Description copied from interface: SecurityContext
      Returns if the user is a member of a particular security role.
      Specified by:
      isUserInRole in interface SecurityContext
      Parameters:
      roleName - the role name
      Returns:
      TRUE if the user is a member of the role, otherwise FALSE
    • getRequest

      public HttpServletRequest getRequest()
      Description copied from interface: SecurityContext
      Returns the current servlet request. Some access controllers may need to examine attributes within the servlet request.
      Specified by:
      getRequest in interface SecurityContext
      Returns:
      the HTTP servlet request