Interface Principal
- All Known Implementing Classes:
AnonymousPrincipal, AnonymousRolePrincipal, ModifiablePrincipal
public interface Principal
The principal represents a user. If no user was logged in, a special anonymous
principal is used.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleangetAttribute(String key) UsePrincipalAttributesfor key namegetName()getRoles()default booleanReturns true if the principal has a role to access the admin.booleanbooleanbooleanbooleanremoveRole(Role role) booleanvoidsetAttribute(String key, @Nullable Object value) UsePrincipalAttributesfor key namevoid
-
Field Details
-
ADMIN_ROLE_TYPES
-
-
Method Details
-
isAnonymous
boolean isAnonymous() -
requiresTwoFactorAuth
boolean requiresTwoFactorAuth() -
isSupportUser
boolean isSupportUser() -
getName
String getName() -
setName
- Throws:
UnauthorizedException
-
getRoles
-
addRole
- Throws:
UnauthorizedException
-
removeRole
- Throws:
UnauthorizedException
-
hasRole
-
hasAdminRole
default boolean hasAdminRole()Returns true if the principal has a role to access the admin. -
setAttribute
UsePrincipalAttributesfor key name -
getAttribute
UsePrincipalAttributesfor key name -
getAttributeKeys
-
getPrimaryKey
-