Interface SecurityContext


public interface SecurityContext
Security context in which an endpoint is being invoked.
Since:
2.0.0
Author:
Andy Wilkinson
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final SecurityContext
    Empty security context.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the currently authenticated Principal or null.
    boolean
    Returns true if the currently authenticated user is in the given role, or false otherwise.
  • Field Details

  • Method Details

    • getPrincipal

      Principal getPrincipal()
      Return the currently authenticated Principal or null.
      Returns:
      the principal or null
    • isUserInRole

      boolean isUserInRole(String role)
      Returns true if the currently authenticated user is in the given role, or false otherwise.
      Parameters:
      role - name of the role
      Returns:
      true if the user is in the given role