mirror of
https://github.com/ash-project/ash.git
synced 2024-09-19 13:03:02 +12:00
chore: add actor to policy errors for later use
This commit is contained in:
parent
f0c6e86d45
commit
622561dc90
2 changed files with 6 additions and 0 deletions
|
@ -11,6 +11,7 @@ defmodule Ash.Error.Forbidden.Policy do
|
|||
scenarios: [],
|
||||
facts: %{},
|
||||
filter: nil,
|
||||
actor: nil,
|
||||
policy_breakdown?: false,
|
||||
must_pass_strict_check?: false,
|
||||
for_fields: nil,
|
||||
|
|
|
@ -484,6 +484,7 @@ defmodule Ash.Policy.Authorizer do
|
|||
policies: Map.get(state, :policies),
|
||||
resource: Map.get(state, :resource),
|
||||
action: Map.get(state, :action),
|
||||
actor: Map.get(state, :actor),
|
||||
changeset_doesnt_match_filter: true,
|
||||
filter: filter
|
||||
)
|
||||
|
@ -496,6 +497,7 @@ defmodule Ash.Policy.Authorizer do
|
|||
policies: Map.get(state, :policies),
|
||||
resource: Map.get(state, :resource),
|
||||
action: Map.get(state, :action),
|
||||
actor: Map.get(state, :actor),
|
||||
must_pass_strict_check?: true
|
||||
)
|
||||
end
|
||||
|
@ -507,6 +509,7 @@ defmodule Ash.Policy.Authorizer do
|
|||
policies: Map.get(state, :policies),
|
||||
resource: Map.get(state, :resource),
|
||||
action: Map.get(state, :action),
|
||||
actor: Map.get(state, :actor),
|
||||
must_pass_strict_check?: true
|
||||
)
|
||||
end
|
||||
|
@ -1507,6 +1510,7 @@ defmodule Ash.Policy.Authorizer do
|
|||
context_description: opts[:context_description],
|
||||
for_fields: opts[:for_fields],
|
||||
resource: Map.get(authorizer, :resource),
|
||||
actor: Map.get(authorizer, :action),
|
||||
action: Map.get(authorizer, :action),
|
||||
scenarios: []
|
||||
)}
|
||||
|
@ -1529,6 +1533,7 @@ defmodule Ash.Policy.Authorizer do
|
|||
for_fields: opts[:for_fields],
|
||||
resource: Map.get(authorizer, :resource),
|
||||
action: Map.get(authorizer, :action),
|
||||
actor: Map.get(authorizer, :action),
|
||||
scenarios: []
|
||||
)}
|
||||
|
||||
|
|
Loading…
Reference in a new issue