Closed Burgestrand closed 2 years ago
NB: I used to override def policy(record)
(to add a namespace to the records and thus load namespaced policies when in an admin context) but that method is not called by def authorize
any more, so it makes the overriding more difficult. Now I have to override both def pundit
and def authorize
.
@sedubois have you tried the suggestion laid out in https://github.com/varvet/pundit#policy-namespacing?
If it doesn't work, please raise an issue.
Closes #689 Closes #694 Closes #666
Using
policy_class
and namespacing are two different ways of doing the same thing (specifying which policy to use). When both are given, we ignore the namespacing and rely on policy class since it's more specific — when we do so, we need to strip the namespace when passing the record to the policy class.This is a refactor of #694.
TODO: