I am working with AshPaperTrail and I am enjoying it very much. One thing I am wondering is if there could be a way to allow the papertrail resource to just “inherit” the policies of whatever it is on such that anyone who can access the original resource can also create/read/update/destroy depending on whether they can do those things to the source resource.
I am currently defining the policies inside of a mixin.
Eg. If you can read App.User you should be able to read App.User.Version.
I know I can just allow accessing_from(App.User, :paper_trail_versions)
but I might want to access it from another resource other than directly off of the main resource and I don’t necessarily want to have to define an accessing_from for every resource that I happen to use it from. Possibly this isn’t a good idea and opens up security holes that I haven’t thought of but I think it makes sense as a baseline.
Any help is greatly appreciated.