index 9d67466..2f60804 100644
a
|
b
|
class ModelBackend(object):
|
25 | 25 | groups. |
26 | 26 | """ |
27 | 27 | if not hasattr(user_obj, '_group_perm_cache'): |
28 | | perms = Permission.objects.filter(group__user=user_obj |
29 | | ).values_list('content_type__app_label', 'codename' |
30 | | ).order_by() |
| 28 | if user_obj.is_superuser: |
| 29 | perms = Permission.objects.all() |
| 30 | else: |
| 31 | perms = Permission.objects.filter(group__user=user_obj) |
| 32 | perms = perms.values_list('content_type__app_label', 'codename').order_by() |
31 | 33 | user_obj._group_perm_cache = set(["%s.%s" % (ct, name) for ct, name in perms]) |
32 | 34 | return user_obj._group_perm_cache |
33 | 35 | |