Package ch.tocco.nice2.security.api
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.
-
Method Summary
Modifier and TypeMethodDescriptionbooleangetAttribute(String key) getName()getRoles()booleanbooleanbooleanbooleanremoveRole(Role role) booleanvoidsetAttribute(String key, @Nullable Object value) void
-
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
-
setAttribute
-
getAttribute
-
getAttributeKeys
-
getPrimaryKey
-