Skip to content

Commit

Permalink
fix: add default to private_fields_policy in Ash.Policy.Info (#1329)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasJ authored Jul 22, 2024
1 parent bad62c1 commit e6d52f2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/ash/policy/info.ex
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,16 @@ defmodule Ash.Policy.Info do
|> set_access_type(default_access_type(resource))
end

@private_fields_policy_default Application.compile_env(:ash, :policies)[:private_fields] ||
:show

def private_fields_policy(resource) do
Extension.get_opt(resource, [:field_policies], :private_fields)
Extension.get_opt(
resource,
[:field_policies],
:private_fields,
@private_fields_policy_default
)
end

def policies(domain, resource) do
Expand Down

0 comments on commit e6d52f2

Please sign in to comment.