mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 21:43:02 +12:00
improvement: thread context through when loading data
This commit is contained in:
parent
3a4b82a41e
commit
e29ad1fcb1
1 changed files with 6 additions and 2 deletions
|
@ -3,9 +3,13 @@ defmodule Ash.Resource.Change.Load do
|
||||||
use Ash.Resource.Change
|
use Ash.Resource.Change
|
||||||
alias Ash.Changeset
|
alias Ash.Changeset
|
||||||
|
|
||||||
def change(changeset, opts, _) do
|
def change(changeset, opts, context) do
|
||||||
Changeset.after_action(changeset, fn changeset, result ->
|
Changeset.after_action(changeset, fn changeset, result ->
|
||||||
changeset.api.load(result, opts[:target])
|
changeset.api.load(result, opts[:target],
|
||||||
|
authorize?: context[:authorize?],
|
||||||
|
actor: context[:actor],
|
||||||
|
tracer: context[:tracer]
|
||||||
|
)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue