Alternera.Resource.Checks.TenantRole (alternera_resource_sdk v0.9.0)

Copy Markdown View Source

Whether the actor's role in the tenant allows the action: a read, and a generic action in the resource's read_only_actions, needs any role there, everything else needs tenant_admin, as the host decides (Alternera.Resource.Host.role_allows?/3).

The tenant comes from the query or changeset, which attribute multitenancy always fills. A check that finds none refuses and logs a warning.

Summary

Functions

eager_evaluate?()

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

init(opts)

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

prefer_expanded_description?()

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

requires_original_data?(_, _)

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

strict_check(actor, context, opts)

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

type()

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