Package org.bremersee.security.access
Interface AccessController
-
- All Known Implementing Classes:
AccessController.Impl
public interface AccessControllerThe access controller.- Author:
- Christian Bremer
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAccessController.ImplThe default access controller implementation.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static AccessControllerfrom(org.bremersee.common.model.AccessControlList acl)Creates an access controller from the given access control list.static AccessControllerfrom(Acl acl)Creates an access controller from the given access control list.default booleanhasAllPermissions(String user, Collection<String> roles, Collection<String> groups, String... permissions)Determines whether the given user with the given roles and groups has all specified permissions.default booleanhasAllPermissions(String user, Collection<String> roles, Collection<String> groups, Collection<String> permissions)Determines whether the given user with the given roles and groups has all specified permissions.default booleanhasAnyPermission(String user, Collection<String> roles, Collection<String> groups, String... permissions)Determines whether the given user with the given roles and groups has at least one of the specified permissions.default booleanhasAnyPermission(String user, Collection<String> roles, Collection<String> groups, Collection<String> permissions)Determines whether the given user with the given roles and groups has at least one of the specified permissions.booleanhasPermission(String user, Collection<String> roles, Collection<String> groups, String permission)Determines whether the given user with the given roles and groups has the specified permission.
-
-
-
Method Detail
-
from
static AccessController from(@Nullable org.bremersee.common.model.AccessControlList acl)
Creates an access controller from the given access control list.- Parameters:
acl- the access control list- Returns:
- the access controller
-
from
static AccessController from(@Nullable Acl acl)
Creates an access controller from the given access control list.- Parameters:
acl- the access control list- Returns:
- the access controller
-
hasPermission
boolean hasPermission(@Nullable String user, @Nullable Collection<String> roles, @Nullable Collection<String> groups, @Nullable String permission)Determines whether the given user with the given roles and groups has the specified permission.- Parameters:
user- the userroles- the rolesgroups- the groupspermission- the permission- Returns:
trueif the user has the permission, otherwisefalse
-
hasAnyPermission
default boolean hasAnyPermission(@Nullable String user, @Nullable Collection<String> roles, @Nullable Collection<String> groups, @Nullable String... permissions)Determines whether the given user with the given roles and groups has at least one of the specified permissions.- Parameters:
user- the userroles- the rolesgroups- the groupspermissions- the permissions- Returns:
trueif the user has at least one permission, otherwisefalse
-
hasAnyPermission
default boolean hasAnyPermission(@Nullable String user, @Nullable Collection<String> roles, @Nullable Collection<String> groups, @Nullable Collection<String> permissions)Determines whether the given user with the given roles and groups has at least one of the specified permissions.- Parameters:
user- the userroles- the rolesgroups- the groupspermissions- the permissions- Returns:
trueif the user has at least one permission, otherwisefalse
-
hasAllPermissions
default boolean hasAllPermissions(String user, Collection<String> roles, Collection<String> groups, String... permissions)
Determines whether the given user with the given roles and groups has all specified permissions.- Parameters:
user- the userroles- the rolesgroups- the groupspermissions- the permissions- Returns:
trueif the user has all permissions, otherwisefalse
-
hasAllPermissions
default boolean hasAllPermissions(String user, Collection<String> roles, Collection<String> groups, Collection<String> permissions)
Determines whether the given user with the given roles and groups has all specified permissions.- Parameters:
user- the userroles- the rolesgroups- the groupspermissions- the permissions- Returns:
trueif the user has all permissions, otherwisefalse
-
-