Skip to content

Support for Pundit Policy Namespacing? #101

Description

@drewnichols

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions