public static HiveAuthorizer getSessionAuthorizer(HiveConf conf) {
    HiveAuthorizer authorizer = SessionState.get().getAuthorizerV2();
    if (authorizer == null) {
      authorizer = new HiveV1Authorizer(conf);
    }

    return authorizer;
  }
Common utilities for Privilege related ddl operations.
ql/src/java/org/apache/hadoop/hive/ql/ddl/privilege/PrivilegeUtils.java