'Returns a list of permission strings that this user has through their
groups. This method queries all available auth backends. If an object
is passed in, only permissions matching this object are returned.'

def get_group_permissions(self, obj=None):

    permissions = set()
    for backend in auth.get_backends():
        if hasattr(backend, u'get_group_permissions'):
            permissions.update(backend.get_group_permissions(self, obj))
    return permissions
