def get_group_permissions(self, user_obj, obj=None):
if user_obj.is_anonymous() or obj is not None:<EOL><INDENT>return set()<EOL><DEDENT>if not hasattr(user_obj, '<STR_LIT>'):<EOL><INDENT>if user_obj.is_superuser:<EOL><INDENT>perms = Permission.objects.all()<EOL><DEDENT>else:<EOL><INDENT>user_groups_field = get_user_class()._meta.get_field('<STR_LIT>')  <EOL>user_groups_query = '<STR_LIT>' % user_groups_field.related_query_name()<EOL>perms = Permission.objects.filter(**{user_groups_query: user_obj})<EOL><DEDENT>perms = perms.values_list('<STR_LIT>', '<STR_LIT>').order_by()<EOL>user_obj._group_perm_cache = set(["<STR_LIT>" % (ct, name) for ct, name in perms])  <EOL><DEDENT>return user_obj._group_perm_cache<EOL>
Returns a set of permission strings that this user has through his/her
groups.