- All Known Implementing Classes:
TrustedIdentityProvider
public interface IdentityProvider
Delivers security information about given identity that includes name and
assigned roles.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic IdentityProviderget()Returns currently associated IdentityProvidergetName()Returns name assigned to the current context, usually refers to user namegetRoles()Returns roles assigned to the current context if anybooleanChecks if given role is assigned to current contextdefault booleanisAdmin()Checks if given identity is an adminstatic booleanisSet()Returns map of additional properties that can be consumed byAccessPolicyimplementationsstatic voidset(IdentityProvider identityProvider)
-
Field Details
-
UNKNOWN_USER_IDENTITY
- See Also:
-
current
-
-
Method Details
-
getName
String getName()Returns name assigned to the current context, usually refers to user name- Returns:
- assigned name taken from security context
-
getRoles
Returns roles assigned to the current context if any- Returns:
- list of assigned roles or empty list
-
hasRole
Checks if given role is assigned to current context- Parameters:
role- role to be checked- Returns:
- true if the role is found otherwise null
-
isAdmin
default boolean isAdmin()Checks if given identity is an admin- Returns:
- returns true if the identity has admin rights otherwise false
-
properties
Returns map of additional properties that can be consumed byAccessPolicyimplementations- Returns:
- non null map of properties
-
get
Returns currently associated IdentityProvider- Returns:
- current identity provider
-
set
-
isSet
static boolean isSet()
-