接口 SecurityContext


public interface SecurityContext
Security context in which an endpoint is being invoked.
从以下版本开始:
2.0.0
作者:
Andy Wilkinson
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    static final SecurityContext
    Empty security context.
  • 方法概要

    修饰符和类型
    方法
    说明
    Return the currently authenticated Principal or null.
    boolean
    Returns true if the currently authenticated user is in the given role, or false otherwise.
  • 字段详细资料

  • 方法详细资料

    • getPrincipal

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

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