Closed estani closed 4 years ago
The first alternative is what’s described in the docs.
Here’s the docs for headless policies: https://github.com/varvet/pundit/blob/master/README.md#headless-policies
Namespaces: https://github.com/varvet/pundit/blob/master/README.md#policy-namespacing
What is it that needs to be clarified?
Oh! I missed the namespaces... I think is ok as it is, I should have found the other part after finding the headless policy info. Sorry for that!
After a while I found a mention in StackOverflow on how to use headless policies with namespaces. This was the answer:
I later found even another option:
None is very intuitive, it would be good to add it to the documentation, if this is indeed supported (or whatever is the encouraged way of doing it)
(If you ask me, a better solution might have been to use
authorize self
and get the name fromobj.class.name.sub /Controller$/,''
)