Package org.eclipse.ditto.model.things
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 forAuthorizationSubject
s andPermission
s.
-
-
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 anyAuthorizationSubject
contained in the passedAuthorizationContext
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 givenAuthorizationSubject
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 immutableAccessControlList
.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 sequentialStream
with the entries of this ACL as its source.default AccessControlListBuilder
toBuilder()
Deprecated.Returns a mutable builder with a fluent API for an immutableAccessControlList
.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 java.lang.Iterable
forEach, iterator, spliterator
-
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
-
-
-
-
Method Detail
-
newBuilder
static AccessControlListBuilder newBuilder()
Deprecated.Returns a mutable builder with a fluent API for an immutableAccessControlList
.- Returns:
- the new builder.
-
toBuilder
default AccessControlListBuilder toBuilder()
Deprecated.Returns a mutable builder with a fluent API for an immutableAccessControlList
. 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 interfaceorg.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
- ifentryToAdd
isnull
.
-
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 withauthorizationSubject
.furtherPermissions
- additional permissions to be associated withauthorizationSubject
.- 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 isnull
.
-
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 withpermission
.)furtherAuthorizationSubjects
- additional authorization subjects to be associated withpermission
.- 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 isnull
.
-
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
- ifaclEntry
isnull
.
-
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 ifpermissions
is empty. - Throws:
NullPointerException
- ifpermissions
isnull
.
-
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 isnull
.
-
hasPermission
boolean hasPermission(org.eclipse.ditto.model.base.auth.AuthorizationContext authorizationContext, Permission permission, Permission... furtherPermissions)
Deprecated.Indicates whether anyAuthorizationSubject
contained in the passedAuthorizationContext
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 ofauthorizationContext
.furtherPermissions
- additional supposed permissions of any authorization subject ofauthorizationContext
.- Returns:
true
if the Authorization Context contains an authorization subject which has all of the specified permissions.- Throws:
NullPointerException
- if any argument isnull
.
-
hasPermission
boolean hasPermission(org.eclipse.ditto.model.base.auth.AuthorizationSubject authorizationSubject, Permission permission, Permission... furtherPermissions)
Deprecated.Indicates whether the givenAuthorizationSubject
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 isnull
.
-
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
- ifexpectedPermissions
isnull
.
-
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 forauthorizationSubject
,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
- ifauthorizationSubject
isnull
.
-
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
- ifauthorizationSubject
isnull
.
-
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
- ifentry
isnull
.
-
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 isnull
.
-
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
- ifauthorizationSubject
isnull
.
-
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 sequentialStream
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 interfaceorg.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 interfaceorg.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector
-
-