Check a policy manually
Is there a way in Ash to check a policy manually?
I want to check if a particular actor has the ability to update a specific resource. I wasn't able to find how to do that.
My use case is I'm creating a resource by passing in a Google Cloud storage signed url and I need to check if the path in the signed url is valid. Right now I have this:
But as the comment notes, I don't want to check if I can read a visit, I want to check if I can update it (ideally without doing an update)
2 Replies
You could probably create a
Ash.Policy.SimpleCheck
https://ash-hq.org/docs/module/ash/latest/ash-policy-simplecheck or maybe if it is only about the URL a Ash.Resource.Validation
https://ash-hq.org/docs/module/ash/latest/ash-resource-validation would also workThere is also
Api.can
and Api.can?