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 TypeMethodDescriptionboolean
getAttribute
(String key) getName()
getRoles()
boolean
boolean
boolean
boolean
removeRole
(Role role) boolean
void
setAttribute
(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
-