Interface AclBuilder

  • All Known Implementing Classes:
    AclBuilder.Impl

    @Validated
    public interface AclBuilder
    The access control list builder.
    Author:
    Christian Bremer
    • 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 owner
        map - 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 public
        permissions - the permissions
        Returns:
        the acl builder
      • addUser

        AclBuilder addUser​(@Nullable
                           String user,
                           @Nullable
                           String... permissions)
        Adds user.
        Parameters:
        user - the user
        permissions - the permissions
        Returns:
        the acl builder
      • addRole

        AclBuilder addRole​(@Nullable
                           String role,
                           @Nullable
                           String... permissions)
        Adds role.
        Parameters:
        role - the role
        permissions - the permissions
        Returns:
        the acl builder
      • addGroup

        AclBuilder addGroup​(@Nullable
                            String group,
                            @Nullable
                            String... permissions)
        Adds group.
        Parameters:
        group - the group
        permissions - the permissions
        Returns:
        the acl builder
      • removeUser

        AclBuilder removeUser​(@Nullable
                              String user,
                              @Nullable
                              String... permissions)
        Removes user.
        Parameters:
        user - the user
        permissions - the permissions
        Returns:
        the acl builder
      • removeRole

        AclBuilder removeRole​(@Nullable
                              String role,
                              @Nullable
                              String... permissions)
        Removes role.
        Parameters:
        role - the role
        permissions - the permissions
        Returns:
        the acl builder
      • removeGroup

        AclBuilder removeGroup​(@Nullable
                               String group,
                               @Nullable
                               String... permissions)
        Removes group.
        Parameters:
        group - the group
        permissions - 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 role
        permissions - the permissions
        Returns:
        the acl builder
      • ensureAdminAccess

        AclBuilder ensureAdminAccess​(@Nullable
                                     Collection<String> adminRoles,
                                     @Nullable
                                     String... permissions)
        Adds admin access.
        Parameters:
        adminRoles - the admin roles
        permissions - 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 role
        permissions - the permissions
        Returns:
        the acl builder
      • removeAdminAccess

        AclBuilder removeAdminAccess​(@Nullable
                                     Collection<String> adminRoles,
                                     @Nullable
                                     String... permissions)
        Removes admin access.
        Parameters:
        adminRoles - the admin roles
        permissions - 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
      • buildAcl

        default Acl<? extends Ace> buildAcl()
        Build acl.
        Returns:
        the acl
      • buildAccessControlList

        default org.bremersee.common.model.AccessControlList buildAccessControlList()
        Build access control list.
        Returns:
        the access control list