Package org.bremersee.security.access
Interface AclBuilder
-
- All Known Implementing Classes:
AclBuilder.Impl
@Validated public interface AclBuilder
The access control list builder.- Author:
- Christian Bremer
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AclBuilder.Impl
The default access control list builder implementation.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description AclBuilder
addGroup(String group, String... permissions)
Adds group.AclBuilder
addRole(String role, String... permissions)
Adds role.AclBuilder
addUser(String user, String... permissions)
Adds user.<T> T
build(@NotNull AclFactory<T> factory)
Build acl.default org.bremersee.common.model.AccessControlList
buildAccessControlList()
Build access control list.default Acl<? extends Ace>
buildAcl()
Build acl.static AclBuilder
builder()
Instantiates a new access control list builder.AclBuilder
defaults(String... permissions)
Add default access control entries for the given permissions.default AclBuilder
ensureAdminAccess()
Ensures admin access.default AclBuilder
ensureAdminAccess(String adminRole, String... permissions)
Adds admin access.AclBuilder
ensureAdminAccess(Collection<String> adminRoles, String... permissions)
Adds admin access.AclBuilder
from(String owner, Map<String,? extends Ace> map)
From acl (entity) values.AclBuilder
from(org.bremersee.common.model.AccessControlList acl)
From access control list DTO.default AclBuilder
from(Acl<? extends Ace> acl)
From acl (entity).AclBuilder
guest(Boolean isPublic, String... permissions)
Sets guest.AclBuilder
owner(String owner)
Sets owner.default AclBuilder
removeAdminAccess()
Removes admin access.default AclBuilder
removeAdminAccess(String adminRole, String... permissions)
Removes admin access.AclBuilder
removeAdminAccess(Collection<String> adminRoles, String... permissions)
Removes admin access.AclBuilder
removeGroup(String group, String... permissions)
Removes group.AclBuilder
removeRole(String role, String... permissions)
Removes role.AclBuilder
removeUser(String user, String... permissions)
Removes user.AclBuilder
reset()
Reset acl builder.
-
-
-
Method Detail
-
builder
static AclBuilder builder()
Instantiates a new access control list builder.- Returns:
- the acl builder
-
reset
AclBuilder reset()
Reset acl builder.- Returns:
- the acl builder
-
defaults
AclBuilder defaults(@Nullable String... permissions)
Add default access control entries for the given permissions.- Parameters:
permissions
- the permissions- Returns:
- the acl builder
-
from
AclBuilder from(@Nullable org.bremersee.common.model.AccessControlList acl)
From access control list DTO.- Parameters:
acl
- the acl dto- Returns:
- the acl builder
-
from
default AclBuilder from(@Nullable Acl<? extends Ace> acl)
From acl (entity).- Parameters:
acl
- the acl (entity)- Returns:
- the acl builder
-
from
AclBuilder from(String owner, Map<String,? extends Ace> map)
From acl (entity) values.- Parameters:
owner
- the ownermap
- the acl (entity) entry map- Returns:
- the acl builder
-
owner
AclBuilder owner(@Nullable String owner)
Sets owner.- Parameters:
owner
- the owner- Returns:
- the acl builder
-
guest
AclBuilder guest(@Nullable Boolean isPublic, @Nullable String... permissions)
Sets guest.- Parameters:
isPublic
- is publicpermissions
- the permissions- Returns:
- the acl builder
-
addUser
AclBuilder addUser(@Nullable String user, @Nullable String... permissions)
Adds user.- Parameters:
user
- the userpermissions
- the permissions- Returns:
- the acl builder
-
addRole
AclBuilder addRole(@Nullable String role, @Nullable String... permissions)
Adds role.- Parameters:
role
- the rolepermissions
- the permissions- Returns:
- the acl builder
-
addGroup
AclBuilder addGroup(@Nullable String group, @Nullable String... permissions)
Adds group.- Parameters:
group
- the grouppermissions
- the permissions- Returns:
- the acl builder
-
removeUser
AclBuilder removeUser(@Nullable String user, @Nullable String... permissions)
Removes user.- Parameters:
user
- the userpermissions
- the permissions- Returns:
- the acl builder
-
removeRole
AclBuilder removeRole(@Nullable String role, @Nullable String... permissions)
Removes role.- Parameters:
role
- the rolepermissions
- the permissions- Returns:
- the acl builder
-
removeGroup
AclBuilder removeGroup(@Nullable String group, @Nullable String... permissions)
Removes group.- Parameters:
group
- the grouppermissions
- the permissions- Returns:
- the acl builder
-
ensureAdminAccess
default AclBuilder ensureAdminAccess()
Ensures admin access.- Returns:
- the acl builder
-
ensureAdminAccess
default AclBuilder ensureAdminAccess(@Nullable String adminRole, @Nullable String... permissions)
Adds admin access.- Parameters:
adminRole
- the admin rolepermissions
- the permissions- Returns:
- the acl builder
-
ensureAdminAccess
AclBuilder ensureAdminAccess(@Nullable Collection<String> adminRoles, @Nullable String... permissions)
Adds admin access.- Parameters:
adminRoles
- the admin rolespermissions
- the permissions- Returns:
- the acl builder
-
removeAdminAccess
default AclBuilder removeAdminAccess()
Removes admin access.- Returns:
- the acl builder
-
removeAdminAccess
default AclBuilder removeAdminAccess(@Nullable String adminRole, @Nullable String... permissions)
Removes admin access.- Parameters:
adminRole
- the admin rolepermissions
- the permissions- Returns:
- the acl builder
-
removeAdminAccess
AclBuilder removeAdminAccess(@Nullable Collection<String> adminRoles, @Nullable String... permissions)
Removes admin access.- Parameters:
adminRoles
- the admin rolespermissions
- the permissions- Returns:
- the acl builder
-
build
<T> T build(@NotNull @NotNull AclFactory<T> factory)
Build acl.- Type Parameters:
T
- the type of the acl- Parameters:
factory
- the factory- Returns:
- the acl
-
buildAccessControlList
default org.bremersee.common.model.AccessControlList buildAccessControlList()
Build access control list.- Returns:
- the access control list
-
-