Interface AccessControlList

  • All Superinterfaces:
    Iterable<AclEntry>, org.eclipse.ditto.model.base.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>, org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector, org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelectorAndPredicate<org.eclipse.ditto.json.JsonField>, org.eclipse.ditto.model.base.json.Jsonifiable.WithPointer<org.eclipse.ditto.json.JsonObject>, org.eclipse.ditto.model.base.json.Jsonifiable.WithPredicate<org.eclipse.ditto.json.JsonObject,​org.eclipse.ditto.json.JsonField>

    @Deprecated
    public interface AccessControlList
    extends Iterable<AclEntry>, org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelectorAndPredicate<org.eclipse.ditto.json.JsonField>
    Deprecated.
    AccessControlLists belong to deprecated API version 1. Use API version 2 with policies instead.
    Represents an association between for AuthorizationSubjects and Permissions.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable

        org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector, org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelectorAndPredicate<T extends Object>, org.eclipse.ditto.model.base.json.Jsonifiable.WithPointer<J extends org.eclipse.ditto.json.JsonValue>, org.eclipse.ditto.model.base.json.Jsonifiable.WithPredicate<J extends org.eclipse.ditto.json.JsonValue,​T extends Object>
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean contains​(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject)
      Deprecated.
      Indicates whether this ACL contains permissions for the specified authorization subject.
      Set<org.eclipse.ditto.model.base.auth.AuthorizationSubject> getAuthorizedSubjectsFor​(Permission permission, Permission... furtherPermissions)
      Deprecated.
      Returns all authorization subjects for the specified permission(s), i.
      Set<org.eclipse.ditto.model.base.auth.AuthorizationSubject> getAuthorizedSubjectsFor​(Permissions expectedPermissions)
      Deprecated.
      Returns all authorization subjects for the specified permissions, i.
      Set<AclEntry> getEntriesSet()
      Deprecated.
      Returns the entries of this ACL as set.
      Optional<AclEntry> getEntryFor​(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject)
      Deprecated.
      Returns an ACL entry for the specified authorization subject.
      Permissions getPermissionsOf​(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject)
      Deprecated.
      Returns all permissions for the specified authorization subject.
      int getSize()
      Deprecated.
      Returns the amount of entries this ACL has.
      default org.eclipse.ditto.model.base.json.JsonSchemaVersion[] getSupportedSchemaVersions()
      Deprecated.
      AccessControlList is only available in JsonSchemaVersion V_1.
      boolean hasPermission​(org.eclipse.ditto.model.base.auth.AuthorizationContext authorizationContext, Permission permission, Permission... furtherPermissions)
      Deprecated.
      Indicates whether any AuthorizationSubject contained in the passed AuthorizationContext has at least all of the specified permissions.
      boolean hasPermission​(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject, Permission permission, Permission... furtherPermissions)
      Deprecated.
      Indicates whether the given AuthorizationSubject has at least all of the specified permissions.
      boolean isEmpty()
      Deprecated.
      Indicates whether this ACL is empty.
      AccessControlList merge​(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject, Permission permission, Permission... furtherPermissions)
      Deprecated.
      Creates an association between the specified authorization subject and one or more permissions.
      AccessControlList merge​(AclEntry entry)
      Deprecated.
      Adds the specified entry to this ACL.
      AccessControlList merge​(Permission permission, org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject, org.eclipse.ditto.model.base.auth.AuthorizationSubject... furtherAuthorizationSubjects)
      Deprecated.
      Creates an associated between the specified permission and one or more authorization subjects.
      static AccessControlListBuilder newBuilder()
      Deprecated.
      Returns a mutable builder with a fluent API for an immutable AccessControlList.
      AccessControlList removeAllPermissionsOf​(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject)
      Deprecated.
      Removes all permissions which are associated to the specified authorization subject in this ACL.
      AccessControlList removeEntry​(AclEntry entry)
      Deprecated.
      Removes the specified entry from this ACL.
      AccessControlList removePermission​(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject, Permission permission, Permission... furtherPermissions)
      Deprecated.
      Removes the given permission(s) from the entry of this ACL which has the given authorization subject.
      AccessControlList setEntry​(AclEntry aclEntry)
      Deprecated.
      Sets the specified entry to a copy this ACL.
      AccessControlList setForAllAuthorizationSubjects​(Permissions permissions)
      Deprecated.
      Sets the specified permissions to all authorization subjects of this ACL.
      Stream<AclEntry> stream()
      Deprecated.
      Returns a sequential Stream with the entries of this ACL as its source.
      default AccessControlListBuilder toBuilder()
      Deprecated.
      Returns a mutable builder with a fluent API for an immutable AccessControlList.
      default org.eclipse.ditto.json.JsonObject toJson()
      Deprecated.
      Returns all non hidden marked fields of this ACL.
      default org.eclipse.ditto.json.JsonObject toJson​(org.eclipse.ditto.model.base.json.JsonSchemaVersion schemaVersion, org.eclipse.ditto.json.JsonFieldSelector fieldSelector)
      Deprecated.
       
      • Methods inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable

        getImplementedSchemaVersion, getLatestSchemaVersion, implementsSchemaVersion, implementsSchemaVersion, toJsonString
      • Methods inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector

        toJson, toJson, toJson, toJsonString, toJsonString
      • Methods inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelectorAndPredicate

        toJson, toJson, toJsonString, toJsonString
      • Methods inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable.WithPointer

        toJsonString, toJsonString
      • Methods inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable.WithPredicate

        toJson, toJson, toJsonString, toJsonString
    • Method Detail

      • newBuilder

        static AccessControlListBuilder newBuilder()
        Deprecated.
        Returns a mutable builder with a fluent API for an immutable AccessControlList.
        Returns:
        the new builder.
      • toBuilder

        default AccessControlListBuilder toBuilder()
        Deprecated.
        Returns a mutable builder with a fluent API for an immutable AccessControlList. The builder is initialised with the ACL entries of this instance.
        Returns:
        the new builder.
      • getSupportedSchemaVersions

        default org.eclipse.ditto.model.base.json.JsonSchemaVersion[] getSupportedSchemaVersions()
        Deprecated.
        AccessControlList is only available in JsonSchemaVersion V_1.
        Specified by:
        getSupportedSchemaVersions in interface org.eclipse.ditto.model.base.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>
        Returns:
        the supported JsonSchemaVersions of AccessControlList.
      • merge

        AccessControlList merge​(AclEntry entry)
        Deprecated.
        Adds the specified entry to this ACL. The permissions of this entry are merged with possibly existing permissions in this ACL for the authorization subject of the specified entry.
        Parameters:
        entry - the entry to be added.
        Returns:
        a copy of this ACL which additionally contains the specified entry.
        Throws:
        NullPointerException - if entryToAdd is null.
      • merge

        AccessControlList merge​(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject,
                                Permission permission,
                                Permission... furtherPermissions)
        Deprecated.
        Creates an association between the specified authorization subject and one or more permissions. If there are already permissions for the subject, the specified permissions are merged with them.
        Parameters:
        authorizationSubject - the authorization subject to be associated with the specified permission(s).
        permission - the permission to be associated with authorizationSubject.
        furtherPermissions - additional permissions to be associated with authorizationSubject.
        Returns:
        a copy of this ACL which additionally contains at least one entry for the specified authorization subject and permission(s).
        Throws:
        NullPointerException - if any argument is null.
      • merge

        AccessControlList merge​(Permission permission,
                                org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject,
                                org.eclipse.ditto.model.base.auth.AuthorizationSubject... furtherAuthorizationSubjects)
        Deprecated.
        Creates an associated between the specified permission and one or more authorization subjects. The specified arguments are merged with existing associations.
        Parameters:
        permission - the permission to be associated with the specified authorization subject(s).
        authorizationSubject - the authorization subject to be associated with permission.)
        furtherAuthorizationSubjects - additional authorization subjects to be associated with permission.
        Returns:
        a copy of this ACL which additionally contains at least one entry for the specified Access Control Permission and authorization subject(s).
        Throws:
        NullPointerException - if any argument is null.
      • setEntry

        AccessControlList setEntry​(AclEntry aclEntry)
        Deprecated.
        Sets the specified entry to a copy this ACL. A previous entry for the same authorization subject is replaced by the specified one.
        Parameters:
        aclEntry - the entry to be set to this ACL.
        Returns:
        a copy of this ACL with aclEntry set.
        Throws:
        NullPointerException - if aclEntry is null.
      • setForAllAuthorizationSubjects

        AccessControlList setForAllAuthorizationSubjects​(Permissions permissions)
        Deprecated.
        Sets the specified permissions to all authorization subjects of this ACL. All previous settings are overwritten. Thus if the specified set of permissions is empty this ACL is cleared completely.
        Parameters:
        permissions - the permissions to set for all authorization subjects of this ACL.
        Returns:
        a copy of this ACL with the permissions set for all authorization subjects or an empty ACL if permissions is empty.
        Throws:
        NullPointerException - if permissions is null.
      • getAuthorizedSubjectsFor

        Set<org.eclipse.ditto.model.base.auth.AuthorizationSubject> getAuthorizedSubjectsFor​(Permission permission,
                                                                                             Permission... furtherPermissions)
        Deprecated.
        Returns all authorization subjects for the specified permission(s), i. e. each returned subject has at least all specified permissions.
        Parameters:
        permission - the permission to get all associated authorization subjects for.
        furtherPermissions - additional permissions to get all associated authorization subjects for.
        Returns:
        an unsorted set containing all authorization subjects which are associated with permission. The returned set is mutable but disjoint from this ACL; thus modifying the set does not have an impact on this ACL.
        Throws:
        NullPointerException - if any argument is null.
      • hasPermission

        boolean hasPermission​(org.eclipse.ditto.model.base.auth.AuthorizationContext authorizationContext,
                              Permission permission,
                              Permission... furtherPermissions)
        Deprecated.
        Indicates whether any AuthorizationSubject contained in the passed AuthorizationContext has at least all of the specified permissions.
        Parameters:
        authorizationContext - the Authorization Context whose authorization subjects are to be searched for the specified permissions.
        permission - the supposed permission of any authorization subject of authorizationContext.
        furtherPermissions - additional supposed permissions of any authorization subject of authorizationContext.
        Returns:
        true if the Authorization Context contains an authorization subject which has all of the specified permissions.
        Throws:
        NullPointerException - if any argument is null.
      • hasPermission

        boolean hasPermission​(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject,
                              Permission permission,
                              Permission... furtherPermissions)
        Deprecated.
        Indicates whether the given AuthorizationSubject has at least all of the specified permissions.
        Parameters:
        authorizationSubject - the authorization subjects of which the permissions are checked.
        permission - the supposed permission.
        furtherPermissions - additional supposed permissions.
        Returns:
        true if the authorization subject has all of the specified permissions.
        Throws:
        NullPointerException - if any argument is null.
      • getAuthorizedSubjectsFor

        Set<org.eclipse.ditto.model.base.auth.AuthorizationSubject> getAuthorizedSubjectsFor​(Permissions expectedPermissions)
        Deprecated.
        Returns all authorization subjects for the specified permissions, i. e. each returned subject has at least all specified permissions.
        Parameters:
        expectedPermissions - the permissions to get all associated authorization subjects for.
        Returns:
        an unsorted set containing all authorization subjects which are associated with permission. The returned set is mutable but disjoint from this ACL; thus modifying the set does not have an impact on this ACL.
        Throws:
        NullPointerException - if expectedPermissions is null.
      • contains

        boolean contains​(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject)
        Deprecated.
        Indicates whether this ACL contains permissions for the specified authorization subject.
        Parameters:
        authorizationSubject - the authorization subject to check if this ACL has permissions for.
        Returns:
        true if this ACL contains permissions for authorizationSubject, false else.
      • getEntryFor

        Optional<AclEntry> getEntryFor​(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject)
        Deprecated.
        Returns an ACL entry for the specified authorization subject.
        Parameters:
        authorizationSubject - the authorization subject get the ACL entry for.
        Returns:
        the ACL entry.
        Throws:
        NullPointerException - if authorizationSubject is null.
      • getPermissionsOf

        Permissions getPermissionsOf​(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject)
        Deprecated.
        Returns all permissions for the specified authorization subject.
        Parameters:
        authorizationSubject - the authorization subject to get all associated permissions for.
        Returns:
        all permissions which are associated with authorizationSubject. The returned set is mutable but disjoint from this ACL; thus modifying the set does not have an impact on this ACL.
        Throws:
        NullPointerException - if authorizationSubject is null.
      • removeEntry

        AccessControlList removeEntry​(AclEntry entry)
        Deprecated.
        Removes the specified entry from this ACL.
        Parameters:
        entry - the entry to be removed from this ACL.
        Returns:
        a copy of this ACL which does not contain the specified entry anymore.
        Throws:
        NullPointerException - if entry is null.
      • removePermission

        AccessControlList removePermission​(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject,
                                           Permission permission,
                                           Permission... furtherPermissions)
        Deprecated.
        Removes the given permission(s) from the entry of this ACL which has the given authorization subject. If after removal the entry has no permissions left, it will be entirely removed from this ACL.
        Parameters:
        authorizationSubject - the authorization subject of the entry.
        permission - the permission of the entry to be removed.
        furtherPermissions - additional permissions to be removed.
        Returns:
        a copy of this ACL with the changed state.
        Throws:
        NullPointerException - if any argument is null.
      • removeAllPermissionsOf

        AccessControlList removeAllPermissionsOf​(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject)
        Deprecated.
        Removes all permissions which are associated to the specified authorization subject in this ACL.
        Parameters:
        authorizationSubject - the authorization subject of which all permissions are to be removed.
        Returns:
        a copy of this ACL which does not contain any entries which are associated with the specified authorization subject.
        Throws:
        NullPointerException - if authorizationSubject is null.
      • isEmpty

        boolean isEmpty()
        Deprecated.
        Indicates whether this ACL is empty.
        Returns:
        true if this ACL does not contain any entry, false else.
      • getSize

        int getSize()
        Deprecated.
        Returns the amount of entries this ACL has.
        Returns:
        this ACL's entries amount.
      • getEntriesSet

        Set<AclEntry> getEntriesSet()
        Deprecated.
        Returns the entries of this ACL as set. The returned set is modifiable but disjoint from this ACL; thus modifying the entry set has no impact on this ACL.
        Returns:
        an unsorted set of this ACL's entries.
      • stream

        Stream<AclEntry> stream()
        Deprecated.
        Returns a sequential Stream with the entries of this ACL as its source.
        Returns:
        a sequential stream of the entries of this ACL.
      • toJson

        default org.eclipse.ditto.json.JsonObject toJson()
        Deprecated.
        Returns all non hidden marked fields of this ACL.
        Specified by:
        toJson in interface org.eclipse.ditto.model.base.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>
        Returns:
        a JSON object representation of this ACL including only non hidden marked fields.
      • toJson

        default org.eclipse.ditto.json.JsonObject toJson​(org.eclipse.ditto.model.base.json.JsonSchemaVersion schemaVersion,
                                                         org.eclipse.ditto.json.JsonFieldSelector fieldSelector)
        Deprecated.
        Specified by:
        toJson in interface org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector