diff --git a/lib/ash/error/forbidden/policy.ex b/lib/ash/error/forbidden/policy.ex index 6a16c4cb..18372057 100644 --- a/lib/ash/error/forbidden/policy.ex +++ b/lib/ash/error/forbidden/policy.ex @@ -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, diff --git a/lib/ash/policy/authorizer/authorizer.ex b/lib/ash/policy/authorizer/authorizer.ex index a8fe4dfd..d50d09de 100644 --- a/lib/ash/policy/authorizer/authorizer.ex +++ b/lib/ash/policy/authorizer/authorizer.ex @@ -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: [] )}