Policy breakdowns for fields
Is it possible to get a policy breakdown for an
Ash.ForbiddenField
in a record returned by a read action?Solution:Jump to solution
I think they can be logged with
log_policy_breakdowns
but not retrieved from a forbidden field.12 Replies
did you try to turrn on the policy breakdown? i think it may work.
I have that on already, and I get breakdowns for actions, but I just have a value
#Ash.ForbiddenField<field: foo, type: :attribute, ...>
if I try accessing the field that's forbidden.oh: a field policy? not sure about that one, maybe a setting to show that.
AFAIS it's not supported but I think it could be. 🤔 Zach will know best.
for instance
Ash.Error.Forbidden.Policy
has functions exception, message, report; while Ash.Error.Forbidden.ForbiddenField
only has messageSolution
I think they can be logged with
log_policy_breakdowns
but not retrieved from a forbidden field.I added
config :ash, :policies, log_policy_breakdowns: true
to my config.exs
file and reran the test that gets me the forbidden field, but I'm not seeing any new logging.log_policy_breakdowns
takes a log levelHmm, I've changed that to
config :ash, :policies, log_policy_breakdowns: :warning
, and still no logging.try
log_successful_policy_breakdowns: :warning
😢
Can you open an issue, ideally w/ a reproduction
GitHub
Policy breakdown logging throws an error · Issue #2024 · ash-proj...
Describe the bug Setting the config option log_successful_policy_breakdowns causes Ash to throw an error instead of logging a forbidden field. To Reproduce Application.put_env(:ash, :validate_domai...