Ensure that actor
is allowed to perform action
on
resource
.
If the action is permitted with an allow
rule in the policy, then
this method returns None
. If the action is not permitted by the
policy, this method will raise an error.
The error raised by this method depends on whether the actor can perform
the "read"
action on the resource. If they cannot read the resource,
then a NotFound
error is raised. Otherwise, a ForbiddenError
is
raised.
The actor performing the request.
The action the actor is attempting to perform.
The resource being accessed.
Ensure that actor
is allowed to perform action
on a given
resource
's field
.
If the action is permitted by an allow_field
rule in the policy,
then this method returns nothing. If the action is not permitted by the
policy, this method will raise a ForbiddenError
.
The actor performing the request.
The action the actor is attempting to perform on the field.
The resource being accessed.
The name of the field being accessed.
Ensure that actor
is allowed to send request
to the server.
Checks the allow_request
rule of a policy.
If the request is permitted with an allow_request
rule in the
policy, then this method returns nothing. Otherwise, this method raises
a ForbiddenError
.
The actor performing the request.
An object representing the request that was sent by the actor.
Determine the actions actor
is allowed to take on resource
.
Collects all actions allowed by allow rules in the Polar policy for the given combination of actor and resource.
The actor for whom to collect allowed actions
The resource being accessed
A list of the unique allowed actions.
Determine the fields of resource
on which actor
is allowed to
perform action
.
Uses allow_field
rules in the policy to find all allowed fields.
The actor for whom to collect allowed fields.
The action being taken on the field.
The resource being accessed.
A list of the unique allowed fields.
Create a query for all the resources of type resourceCls
that actor
is
allowed to perform action
on.
Subject.
Verb.
Object type.
A query that selects authorized resources of type resourceCls
Determine the resources of type resourceCls
that actor
is allowed to perform action
on.
Subject.
Verb.
Object type or string name of class
An array of authorized resources.
Clear rules from the Polar KB, but retain all registered classes and constants.
Free the underlying WASM instance.
Invariant: ensure that you do not do anything else with an instance
after calling free()
on it.
This should not be something you need to do during the course of regular usage. It's generally only useful for scenarios where large numbers of instances are spun up and not cleanly reaped by the GC, such as during a long-running test process in 'watch' mode.
Query the knowledge base to determine whether an actor is allowed to perform an action upon a resource.
Subject.
Verb.
Object.
An access control decision.
Load a Polar policy file.
Load Polar policy files.
Load a Polar policy string.
Query for a Polar predicate or string.
Query for a Polar rule.
Query for a Polar rule, returning true if there are any results.
Register a JavaScript class for use in Polar policies.
The class to register.
An optional object with extra parameters.
Register a JavaScript value for use in Polar policies.
Start a REPL session.
Register adapter for data filtering query functions.
The Oso authorization API.