private static void addHivePrivObject(Entity privObject, Map<String, List<String>> tableName2Cols,
      List<HivePrivilegeObject> hivePrivObjs, HiveOperationType hiveOpType) throws HiveException {
    HivePrivilegeObjectType privObjType = AuthorizationUtils.getHivePrivilegeObjectType(privObject.getType());
    HivePrivObjectActionType actionType = AuthorizationUtils.getActionType(privObject);
    HivePrivilegeObject hivePrivObject = null;
    switch(privObject.getType()){
    case DATABASE:
      Database database = privObject.getDatabase();
      hivePrivObject = new HivePrivilegeObject(privObjType, database.getName(), null, null, null, actionType, null,
          null, database.getOwnerName(), database.getOwnerType());
      break;
    case TABLE:
      Table table = privObject.getTable();
      List<String> columns = tableName2Cols == null ? null :
          tableName2Cols.get(Table.getCompleteName(table.getDbName(), table.getTableName()));
      hivePrivObject = new HivePrivilegeObject(privObjType, table.getDbName(), table.getTableName(),
          null, columns, actionType, null, null, table.getOwner(), table.getOwnerType());
      if (table.getStorageHandler() != null && HiveConf.getBoolVar(SessionState.getSessionConf(),
          HiveConf.ConfVars.HIVE_AUTHORIZATION_TABLES_ON_STORAGEHANDLERS)) {
        //TODO: add hive privilege object for storage based handlers for create and alter table commands.
        if (privObject instanceof WriteEntity &&
                (hiveOpType == HiveOperationType.CREATETABLE ||
                hiveOpType == HiveOperationType.ALTERTABLE_PROPERTIES ||
                hiveOpType == HiveOperationType.CREATETABLE_AS_SELECT)) {
          try {
            String storageUri = table.getStorageHandler().getURIForAuth(table.getTTable()).toString();
            hivePrivObjs.add(new HivePrivilegeObject(HivePrivilegeObjectType.STORAGEHANDLER_URI, null, storageUri, null, null,
                actionType, null, table.getStorageHandler().getClass().getName(), table.getOwner(), table.getOwnerType()));
          } catch (Exception ex) {
            LOG.error("Exception occurred while getting the URI from storage handler: " + ex.getMessage(), ex);
            throw new HiveException("Exception occurred while getting the URI from storage handler: " + ex.getMessage());
          }
        }
      }
      break;
    case DFS_DIR:
    case LOCAL_DIR:
      hivePrivObject = new HivePrivilegeObject(privObjType, null, privObject.getD().toString(), null, null,
          actionType, null, null, null, null);
      break;
    case FUNCTION:
      if (privObject.getFunction() != null) {
        Function function = privObject.getFunction();
        hivePrivObject = new HivePrivilegeObject(privObjType, function.getDbName(), function.getFunctionName(),
                null, null, actionType, null, function.getClassName(), function.getOwnerName(), function.getOwnerType());
      } else {
        String dbName = privObject.getDatabase() != null ? privObject.getDatabase().getName() : null;
        hivePrivObject = new HivePrivilegeObject(privObjType, dbName, privObject.getFunctionName(),
                null, null, actionType, null, privObject.getClassName(), null, null);
      }
      break;
    case DUMMYPARTITION:
    case PARTITION:
      Table tbl = privObject.getTable();
      List<String> col = tableName2Cols == null ? null :
              tableName2Cols.get(Table.getCompleteName(tbl.getDbName(), tbl.getTableName()));
      hivePrivObject = new HivePrivilegeObject(privObjType, tbl.getDbName(), tbl.getTableName(),
              null, col, actionType, null, null, tbl.getOwner(), tbl.getOwnerType());
      break;
    case SERVICE_NAME:
      hivePrivObject = new HivePrivilegeObject(privObjType, null, privObject.getServiceName(), null,
          null, actionType, null, null, null, null);
      break;
    case DATACONNECTOR:
      DataConnector connector = privObject.getDataConnector();
      hivePrivObject = new HivePrivilegeObject(privObjType, null, connector.getName(), null, null, actionType, null,
              null, connector.getOwnerName(), connector.getOwnerType());
      break;
    default:
      throw new AssertionError("Unexpected object type");
    }
    hivePrivObjs.add(hivePrivObject);
  }
A deferred authorization view is view created by non-super user like spark-user. This view contains a parameter "Authorized"
set to false, so ranger will not authorize it during view creation. When a select statement is issued, then the ranger authorizes
the under lying tables.
@param t the HMS table object
@return boolean value
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/command/CommandAuthorizerV2.java