CreatePolicy 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
-
- Object
- PermissionPolicy
- CreatePolicy
Constructors
- CreatePolicy({String permission = '', bool filterByTenant = true})
-
const
- CreatePolicy.root()
-
const
Properties
- 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
-
isAuthorized(
DbPrincipal principal) → bool -
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