Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version policies #13

Open
rgraff opened this issue Sep 28, 2023 · 2 comments
Open

Version policies #13

rgraff opened this issue Sep 28, 2023 · 2 comments

Comments

@rgraff
Copy link
Contributor

rgraff commented Sep 28, 2023

A couple issues:

  • Version resources are created with an authorize?: false but does this fail if the api has authorize :always
  • Are policies authorized currently or are they globably readable (footgun)
  • Policies can be added via a mixin. Should update the readme.
  • Can we declare policies in the paper_trail section. Might be a lift not worth doing if we can get full support via mixin.
@zachdaniel
Copy link
Contributor

Yeah, I think mixins are the way to go for version policies. You're right that it could be a footman that there are no policies on that resource by default, but I'm not sure yet how to handle that ergonomically. Yes, authorize :always will cause version resources not to fail, but what we can do is set some context i.e %{ash_paper_trail_action?: true} and have a policy that checks for that, so users with authorize :always have a way to approve the actions done by this extension.

@rgraff
Copy link
Contributor Author

rgraff commented Sep 28, 2023

Based on that input I think we should:

  • Add authorizer and bypass policy for a context (%{ash_paper_trail_action?: true}) to essentially make them create only
  • Add a resource option to make them always readable, scoped only by tenant (if applicable)
  • Update readme with example of how to apply policies via mixin for more fine-grained read controls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants