-
Notifications
You must be signed in to change notification settings - Fork 633
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
Overriding both authorize and policy is required for namespacing #723
Comments
I'm inclined to say that the fact that However, you're absolutely right that there's nothing written in the documentation about how to namespace direct calls to |
I want to tackle this issue but I suspect I have not quite understood what it is to be done. |
I can understand the perspective the I opened a new issue (#740) trying to more clearly call this detail out as it's not necessarily related to namespacing in my case. |
Now with pundit/lib/pundit/authorization.rb Lines 19 to 24 in 7e59b98
There's no explicit implementation for that, but I'm thinking something like:
|
The README explains how to namespace policies, however this does not seem to take into account direct calls to
policy
(e.g. callingpolicy(record).show?
from some view). Before the merge of #697, it was possible to only overridepolicy
andauthorize
would automatically be properly scoped as well. Now it has apparently become necessary to override bothauthorize
andpolicy
inPundit::Authorization
. It still works, but is just now more cumbersome, and also required some figuring out when performing the upgrade to Pundit 2.2.0.Opening this issue as suggested in #697.
The text was updated successfully, but these errors were encountered: