def METHOD_NAME(self, path, val, user_grants, all_ns, thr=None):
    errors = []
    req_grants = thr.parse_grants(val, all_ns)
    for role, namespaces in req_grants.items():
        if namespaces is None:
            # cluster roles
            if role not in user_grants:
                errors.append("%s: keyword grant=%s requires the %s cluster role" % (path, val, role))
        else:
            # namespaces roles
            delta = set(namespaces) - set(user_grants.get(role, []))
            if delta:
                delta = sorted(list(delta))
                errors.append("%s: keyword grant=%s requires the %s:%s privilege" % (path, val, role, ",".join(delta)))
    return errors