PolicyEntry class
A specific Policy for one Entry
in the directory or repository.
A policy consists of PolicyGroups and manages the access control to one
specific Entry
in the S3I-Directory or S3i-Repository.
For more background information see: https://www.eclipse.org/ditto/basic-policy.html
In the S3I-Concept there are two special PolicyGroups which have a specific meaning:
- owner: An owner has READ and WRITE permission to everything (thing:/, policy:/, message:/)
- observer: An observer has only READ permission to the thing part (thing:/)
Constructors
-
PolicyEntry.new(String id, {Map<
String, PolicyGroup> ? entryGroups}) -
Creates a PolicyEntry with the given
id
andentryGroups
. -
PolicyEntry.fromJson(Map<
String, dynamic> map) -
Returns a PolicyEntry with groups (subjects and resources) specified
in the
map
.factory
Properties
Methods
-
deleteGroup(
String name) → PolicyGroup? -
Removes
name
and its associated PolicyGroup from_groups
. -
getAllObservers(
) → Map< String, PolicySubject> -
Returns a map of PolicySubjects who are in the special group
observer
. -
getAllOwners(
) → Map< String, PolicySubject> -
Returns a map of PolicySubjects who are in the special group
owner
. -
getGroup(
String name) → PolicyGroup -
Returns the PolicyGroup in
_groups
matchingname
. -
getGroups(
) → Map< String, PolicyGroup> -
Returns the value of
_groups
. -
insertGroup(
PolicyGroup group) → void -
Adds the given
group
to the_groups
of this entry. -
insertObserver(
PolicySubject observer) → void -
Adds the given
observer
to the special groupobserver
. -
insertOwner(
PolicySubject owner) → void -
Adds the given
owner
to the special groupowner
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeObserver(
String name) → PolicySubject? -
Removes
name
and its associated PolicySubject from theobserver
group. -
removeOwner(
String name) → PolicySubject? -
Removes
name
and its associated PolicySubject from theowner
group. -
toJson(
) → Map< String, dynamic> - Returns the stored information about this PolicyEntry in a Map which could be directly used to creates a json entry.
-
toString(
) → String - A string representation of this object.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- observerGroupKey → const String
-
The key of the special
observer
group. - ownerGroupKey → const String
-
The key of the special
owner
group.