@Override
  public void authorize(Database db, Privilege[] readRequiredPriv, Privilege[] writeRequiredPriv)
      throws HiveException, AuthorizationException {

    try {
      initWh();
    } catch (MetaException ex) {
      throw hiveException(ex);
    }

    Path path = getDbLocation(db);

    // extract drop privileges
    DropPrivilegeExtractor privExtractor = new DropPrivilegeExtractor(readRequiredPriv,
        writeRequiredPriv);
    readRequiredPriv = privExtractor.getReadReqPriv();
    writeRequiredPriv = privExtractor.getWriteReqPriv();

    // authorize drops if there was a drop privilege requirement
    if(privExtractor.hasDropPrivilege()) {
      checkDeletePermission(path, getConf(), authenticator.getUserName());
    }

    authorize(path, readRequiredPriv, writeRequiredPriv);
  }
Make sure that the warehouse variable is set up properly.
@throws MetaException if unable to instantiate
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/StorageBasedAuthorizationProvider.java