Package com.vaadin.cdi.access
Class AccessControl
java.lang.Object
com.vaadin.cdi.access.AccessControl
- Direct Known Subclasses:
JaasAccessControl
Access control base class.
Various implementations can exist (default JAAS, others with
Alternative) and the active implementation can be selected in
beans.xml .-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract StringReturns the principal (user) name of the currently logged in user.abstract booleanisUserInRole(String role) Checks if the current user has a role.booleanisUserInSomeRole(String... roles) Checks if the user has any of the given roles.abstract booleanReturns true if some used has logged in.
-
Constructor Details
-
AccessControl
public AccessControl()
-
-
Method Details
-
isUserSignedIn
public abstract boolean isUserSignedIn()Returns true if some used has logged in.- Returns:
- true if a user is logged in
-
isUserInRole
Checks if the current user has a role.- Parameters:
role-- Returns:
- true if currently logged in user is in given role
-
getPrincipalName
Returns the principal (user) name of the currently logged in user.- Returns:
- name of the user that is currently logged in, if no user is logged in null will be returned.
-
isUserInSomeRole
Checks if the user has any of the given roles.- Parameters:
roles-- Returns:
- true if currently logged in user is in some of given roles
-