MishkaCmsCore. Accounts. Checks. ExtensionInteraction
(Mishka CMS Core v0.0.1)
Copy Markdown
View Source
This check is true if the access is coming from a relationship load.
This check allows resources to be accessed through relationship loads from
other resources, without creating hard dependencies. It simply checks if
Ash's accessing_from context is present, which indicates the access is
happening through a relationship load.
Usage in policies
policies do
bypass ExtensionInteraction do
authorize_if always()
end
endThis pattern allows any resource to load related data through relationships while maintaining proper authorization boundaries. The check doesn't distinguish between "core" and "extension" resources - it simply allows relationship-based access.
How it works
When Ash loads a relationship (e.g., Blogger.user), it automatically sets
accessing_from: %{name: :user, source: MishkaBlog.Blogger} in the query
context. This check detects that context and grants access.
Summary
Functions
Callback implementation for Ash.Policy.Check.eager_evaluate?/0.
Callback implementation for Ash.Policy.Check.init/1.
Callback implementation for Ash.Policy.Check.prefer_expanded_description?/0.
Callback implementation for Ash.Policy.Check.requires_original_data?/2.
Callback implementation for Ash.Policy.Check.strict_check/3.
Callback implementation for Ash.Policy.Check.type/0.
Functions
Callback implementation for Ash.Policy.Check.eager_evaluate?/0.
Callback implementation for Ash.Policy.Check.init/1.
Callback implementation for Ash.Policy.Check.prefer_expanded_description?/0.
Callback implementation for Ash.Policy.Check.requires_original_data?/2.
Callback implementation for Ash.Policy.Check.strict_check/3.
Callback implementation for Ash.Policy.Check.type/0.