-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Labels
Description
Perhaps I have overlooked it but it seems that the way this gem is designed we are unable to take advantage of Pundit's Policy Namespacing feature.
We have a motivation similar to #8 in which users can access our apis under different contexts, such as an admin or a user, and thus should receive different policies and different scopes. The namespacing seemed a good fit as we could pass the PolicyFinder an array containing the context and the object instead just the object and it will resolve policy classes as follows:
PolicyFinder.new([:admin, post]) # => Admin::PostPolicy
PolicyFinder.new([:user, post]) # => User::PostPolicy
Was this intentional? Am I missing something?
Subtletree, drewnichols, nadnoslen, jaydorsey, g13ydson and 1 more