private void checkAuthorization(ScheduledQueryMaintenanceRequestType type, ScheduledQuery schq)
      throws SemanticException {
    boolean schqAuthorization = (SessionState.get().getAuthorizerV2() != null)
        && conf.getBoolVar(ConfVars.HIVE_SECURITY_AUTHORIZATION_SCHEDULED_QUERIES_SUPPORTED);

    try {
      if (!schqAuthorization) {
        String currentUser = getUserName();
        if (!Objects.equal(currentUser, schq.getUser())) {
          throw new HiveAccessControlException(
              "Authorization of scheduled queries is not enabled - only owners may change scheduled queries (currentUser: "
                  + currentUser + ", owner: " + schq.getUser() + ")");
        }
      } else {
        HiveOperationType opType = toHiveOpType(type);
        List<HivePrivilegeObject> privObjects = new ArrayList<HivePrivilegeObject>();
        ScheduledQueryKey key = schq.getScheduleKey();
        privObjects.add(
            HivePrivilegeObject.forScheduledQuery(schq.getUser(), key.getClusterNamespace(), key.getScheduleName()));

        SessionState.get().getAuthorizerV2().checkPrivileges(opType, privObjects, privObjects,
            new HiveAuthzContext.Builder().build());
      }

    } catch (Exception e) {
      throw new SemanticException(e.getMessage(), e);
    }
  }
Composes an overlay object.

Output is a flattened view of the input objects.
having the value from the first one which has it defined from the overlays.
ql/src/java/org/apache/hadoop/hive/ql/parse/ScheduledQueryAnalyzer.java