'Return `True` if permission is granted, `False` otherwise.'

def has_permission(self, request, view):

    if (('username' in request.data) or ('all' in request.data)):
        return request.user.is_superuser
    else:
        return True
