This PR is merely to showcase the fact that the generator is wrong. It is checking for an action need in a list of role needs. This will result in an error in the tests as follows, since it will return [] no a Q(...) object.
FAILED tests/test_generators.py::test_superuser - AttributeError: 'list' object has no attribute 'to_dict'
kudos to @ntarocco for finding out!
Extra question, why do we return [], I guess because there is a noop in the DSL and None would mean extra checks in the policy.
----- More -----
self._load_permissions() is not called anywhere in the query_filters generation. On the other hand, it is used for needs and excludes and that's why it works for permissions (but not for search).
This PR is merely to showcase the fact that the generator is wrong. It is checking for an action need in a list of role needs. This will result in an error in the tests as follows, since it will return
[]
no aQ(...)
object.kudos to @ntarocco for finding out!
Extra question, why do we return
[]
, I guess because there is a noop in the DSL andNone
would mean extra checks in the policy.----- More -----
self._load_permissions()
is not called anywhere in thequery_filters
generation. On the other hand, it is used forneeds
andexcludes
and that's why it works for permissions (but not for search).