SearchPolicy class

Defines authorization policy for search 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 returned by a search operation is required to have for that entity to be returned to the user.

For example, if the method determines that the action is 'read', then all search operations will only return entities that have a share with the 'read' action for the principal. If the actionToDemandOnPrincipal returns an empty string, then the search results are not limited by the shares each entity has for the user.

This policy also determines whether results are limited to the same tenant as the principal's.

Inheritance

Constructors

SearchPolicy({String permission = '', bool filterByTenant = true, String actionToDemand = 'read'})
const
SearchPolicy.root()
const

Properties

actionToDemand String
Which action is to be demanded from the user when the user does not have a permission to search for all entities.
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