Closed youroff closed 7 years ago
Currently, I don't see an easy way to customize the authorizer used per resource at the controller layer. However, I can see this as being in scope for the next major version of Authority, which I don't have a timeline for yet. I'd like to move to a more ActiveModel::Serializers
approach where a default class is inferred from the model, but the controller-level hook allows for exactly that customization.
As far as the dynamic custom actions goes, I'm not 100% sold on the use-case, but I'll keep it in mind.
Authority is now unmaintained - see README.
What would be the proper way to tune authorization workflow for the case when there are multiple controllers to do something different with the same model?
The issue as I see it, that instance level permissions are always checked in authorizer set in model, when for class level check you could set any authorizer in controller. I think, would be natural to use authorizer specified in controller when calling
authorize_action_for @variable
Also, would be nice to use custom actions right away, without declaring them in config. Let's say we have:
This calls
current_user.can_take_photo?(authorizer, ... ?)
and it can't resolve it further, if there's no such item in the map. Would be nice to call it on authorizer as a fallback. Or some other approach?