UpdatePolicy class
Defines authorization policy for update 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 updated is required.
For example, if the method determines that
the action is 'write', then all update operations
will only update entities that have a share
with the 'write' action for the principal
. If
the actionToDemandOnPrincipal returns an empty
string, then the update actions are not limited
by the shares each entity has for the user.
This policy also determines whether updates
are limited to the same tenant as the principal
's.
- Inheritance
-
- Object
- PermissionPolicy
- EntityPermissionPolicy
- UpdatePolicy
- Implementers
Constructors
- UpdatePolicy({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.
final
- 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.
override
-
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