@Override
  public void checkPrivileges(HiveOperationType hiveOpType, List<HivePrivilegeObject> inputHObjs,
                              List<HivePrivilegeObject> outputHObjs, HiveAuthzContext context) throws
          HiveAuthzPluginException, HiveAccessControlException {

    String user         = null;
    String errorMessage = "";
    try {
      user = UserGroupInformation.getLoginUser().getShortUserName();
    } catch (Exception e) {
      throw  new HiveAuthzPluginException("Unable to get UserGroupInformation");
    }

    if (!isOperationAllowed(user)) {
      errorMessage = "Operation type " + hiveOpType + " not allowed for user:" + user;
      throw  new HiveAuthzPluginException(errorMessage);
    }
  }
Test HiveAuthorizer for invoking checkPrivilege Methods for authorization call
Authorizes user sam and rob.
ql/src/test/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/DummyHiveAuthorizer.java