static CommandProcessorResponse authorizeCommand(SessionState ss, HiveOperationType type,
      List<String> command) throws CommandProcessorException {
    if (ss == null) {
      // ss can be null in unit tests
      return null;
    }

    if (ss.isAuthorizationModeV2() &&
        HiveConf.getBoolVar(ss.getConf(), HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED)) {
      String errMsg = "Error authorizing command " + command;
      try {
        authorizeCommandThrowEx(ss, type, command);
        // authorized to perform action
        return null;
      } catch (HiveAuthzPluginException | HiveAccessControlException e) {
        LOG.error(errMsg, e);
        throw new CommandProcessorException(e);
      }
    }
    return null;
  }
Authorize command of given type and arguments

@param ss
@param type
@param command
@return null if there was no authorization error. Otherwise returns  CommandProcessorResponse
capturing the authorization error
ql/src/java/org/apache/hadoop/hive/ql/processors/CommandUtil.java