In version 1.1, module utils.py, function get_roles, I had to change the construction of the queries, in order to make get_roles itself and has_permission work. Here is my code:
groups_ids = [g.id for g in groups]
groups_ids_str = ", ".join([str(id) for id in groups_ids]) # to be used for caching ?
if groups_ids:
query = Q(user_id=user.id) | Q(group_id__in=groups_ids)
prrs = PrincipalRoleRelation.objects.filter(
query, content_id=None
).values("role_id")
(around line 217; made similar change around line 231; I imagine that the variable groups_ids_str should be used for caching, but don't know how.)
It seems that the current version, in Github, needs the same fix.
By, Giovanni
In version 1.1, module
utils.py
, functionget_roles
, I had to change the construction of the queries, in order to makeget_roles
itself andhas_permission
work. Here is my code:(around line 217; made similar change around line 231; I imagine that the variable
groups_ids_str
should be used for caching, but don't know how.)It seems that the current version, in Github, needs the same fix. By, Giovanni