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 SecurityContextNONEEmpty security context.
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PrincipalgetPrincipal()Return the currently authenticatedPrincipalornull.booleanisUserInRole(String role)Returnstrueif 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 authenticatedPrincipalornull.- Returns:
- the principal or
null
isUserInRole
boolean isUserInRole(String role)
Returnstrueif the currently authenticated user is in the givenrole, or false otherwise.- Parameters:
role- name of the role- Returns:
trueif the user is in the given role