AshAuthzed.Checks.Can (ash_authzed v0.2.0)

Copy Markdown View Source

Ash.Policy.FilterCheck that evaluates whether the actor has a given Zanzibar permission on the target resource(s) via AshAuthzed.Adapter.lookup_resources/4, or on a static target object (target: "catalog:main" / on: "catalog:main") via AshAuthzed.Adapter.check?/4.

Works seamlessly for collection reads (Ash.read!), single-record mutations (Ash.update!, Ash.destroy!, Ash.can?), and :create actions when target: "type:id" (or on: "type:id") is specified.

Summary

Functions

auto_filter(actor, authorizer, opts)

Callback implementation for Ash.Policy.Check.auto_filter/3.

auto_filter_not(actor, authorizer, opts)

check(actor, data, authorizer, opts)

Callback implementation for Ash.Policy.Check.check/4.

eager_evaluate?()

Callback implementation for Ash.Policy.Check.eager_evaluate?/0.

expand_description(actor, authorizer, opts)

Callback implementation for Ash.Policy.Check.expand_description/3.

init(opts)

Callback implementation for Ash.Policy.Check.init/1.

prefer_expanded_description?()

Callback implementation for Ash.Policy.Check.prefer_expanded_description?/0.

reject(actor, authorizer, opts)

Callback implementation for Ash.Policy.FilterCheck.reject/3.

requires_original_data?(_, _)

Callback implementation for Ash.Policy.Check.requires_original_data?/2.

strict_check(actor, authorizer, opts)

Callback implementation for Ash.Policy.Check.strict_check/3.

strict_check_context(opts)

type()

Callback implementation for Ash.Policy.Check.type/0.