def get_group_permissions(self, user_obj, obj=None):
        """
        Returns a set of permission strings that this user has through his/her
        groups.
        """
        if not hasattr(user_obj, '_group_perm_cache'):
            # TODO: improve performances
            permissions = [u"%s.%s" % (p.content_type.app_label, p.codename) \
                                        for group in user_obj.groups.all() \
                                            for p in group.permissions.all()]
            user_obj._group_perm_cache = permissions
        return user_obj._group_perm_cache
dataset/ETHPy150Open charles-vdulac/django-roa/django_roa/remoteauth/backends.py/RemoteUserModelBackend.get_group_permissions/original