DeletePolicy class
Defines authorization policy for delete operations.
The purpose of this class is to expose the method actionToDemandOnPrincipal that determines the required shares, containing which action, that each entity that is to be deleted is required.
For example, if the method determines that
the action is 'write', then all delete operations
will only delete entities that have a share
with the 'write' action for the principal
. If
the actionToDemandOnPrincipal returns an empty
string, then the delete actions are not limited
by the shares each entity has for the user.
This policy also determines whether deletions
are limited to the same tenant as the principal
's.
- Inheritance
-
- Object
- PermissionPolicy
- EntityPermissionPolicy
- UpdatePolicy
- DeletePolicy
Constructors
- DeletePolicy({String permission = '', bool filterByTenant = true, String actionToDemand = 'write'})
-
const
Properties
- actionToDemand → String
-
Which action is to be demanded from the
user when the user does not have a permission
to update any entity.
finalinherited
- filterByTenant → bool
-
whether to allow the user to perform the
action on entities other than those strictly
belonging to the same tenant.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- permission → String
-
the permission that will allow the user to
perform the operation on an entity.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
actionToDemandOnPrincipal(
DbPrincipal principal) → String -
Determines the action that shares the entity has
for the user.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited