HiveAuthorizer createHiveMetaStoreAuthorizer() throws Exception {
    HiveAuthorizer ret = null;
    HiveConf hiveConf = (HiveConf)tConfig.get();
    if(hiveConf == null){
      HiveConf hiveConf1 = new HiveConf(super.getConf(), HiveConf.class);
      tConfig.set(hiveConf1);
      hiveConf = hiveConf1;
    }
    HiveAuthorizerFactory authorizerFactory =
        HiveUtils.getAuthorizerFactory(hiveConf, HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER);

    if (authorizerFactory != null) {
      HiveMetastoreAuthenticationProvider authenticator = tAuthenticator.get();

      authenticator.setConf(hiveConf);

      HiveAuthzSessionContext.Builder authzContextBuilder = new HiveAuthzSessionContext.Builder();

      authzContextBuilder.setClientType(HiveAuthzSessionContext.CLIENT_TYPE.HIVEMETASTORE);
      authzContextBuilder.setSessionString("HiveMetaStore");

      HiveAuthzSessionContext authzSessionContext = authzContextBuilder.build();

      ret = authorizerFactory
          .createHiveAuthorizer(new HiveMetastoreClientFactoryImpl(), hiveConf, authenticator, authzSessionContext);
    }

    return ret;
  }
HiveMetaStoreAuthorizer :  Do authorization checks on MetaStore Events in MetaStorePreEventListener
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/HiveMetaStoreAuthorizer.java