Interface SecurityContext
public interface SecurityContext
Security context in which an endpoint is being invoked.- Since:
- 2.0.0
Field Summary
Fields Modifier and Type Field Description static SecurityContext
NONE
Empty security context.
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Principal
getPrincipal()
Return the currently authenticatedPrincipal
ornull
.boolean
isUserInRole(String role)
Returnstrue
if the currently authenticated user is in the givenrole
, or false otherwise.
Field Detail
NONE
static final SecurityContext NONE
Empty security context.
Method Detail
getPrincipal
Principal getPrincipal()
Return the currently authenticatedPrincipal
ornull
.- Returns:
- the principal or
null
isUserInRole
boolean isUserInRole(String role)
Returnstrue
if the currently authenticated user is in the givenrole
, or false otherwise.- Parameters:
role
- name of the role- Returns:
true
if the user is in the given role