@Override
  public void beforeTest(QTestUtil qt) throws Exception {
    if (enabled) {
      qt.getConf().set("hive.test.authz.sstd.hs2.mode", "true");
      qt.getConf().set("hive.security.authorization.manager",
          "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactoryForTest");
      qt.getConf().set("hive.security.authenticator.manager",
          "org.apache.hadoop.hive.ql.security.SessionStateConfigUserAuthenticator");
      qt.getConf().set("hive.security.authorization.enabled", "true");
      SessionState.get().setAuthenticator(null);
      SessionState.get().setAuthorizer(null);
    }
  }
QTest authorizer option

Enables authorization for the qtest.

Example:
--! qt:authorizer
itests/util/src/main/java/org/apache/hadoop/hive/ql/qoption/QTestAuthorizerHandler.java