public boolean hasAllTownOverride(Player player, int blockId, TownyPermission.ActionType action) {

    // check for permissions
    if (plugin.isPermissions()) {
      if (has(
          player,
          PermissionNodes.TOWNY_CLAIMED_ALL.getNode(
              "alltown." + action.toString().toLowerCase() + "." + blockId))) return true;
    } else {

      // Allow ops all access when no permissions
      if (isTownyAdmin(player)) return true;
    }

    return false;
  }
  public boolean hasWildOverride(
      TownyWorld world, Player player, int blockId, TownyPermission.ActionType action) {

    // check for permissions
    if (plugin.isPermissions()) {
      if (has(
          player,
          PermissionNodes.TOWNY_WILD_ALL.getNode(action.toString().toLowerCase() + "." + blockId)))
        return true;

      // No node set but we are using permissions so check world settings (without
      // UnclaimedIgnoreId's).
      switch (action) {
        case BUILD:
          return world.getUnclaimedZoneBuild();
        case DESTROY:
          return world.getUnclaimedZoneDestroy();
        case SWITCH:
          return world.getUnclaimedZoneSwitch();
        case ITEM_USE:
          return world.getUnclaimedZoneItemUse();
      }

    } else {
      /*
       * Not using a permissions plugin
       *
       */

      // Allow ops all access when no permissions
      if (isTownyAdmin(player)) return true;

      // Check world settings as we are not using permissions.
      switch (action) {
        case BUILD:
          return world.getUnclaimedZoneBuild() || world.isUnclaimedZoneIgnoreId(blockId);
        case DESTROY:
          return world.getUnclaimedZoneDestroy() || world.isUnclaimedZoneIgnoreId(blockId);
        case SWITCH:
          return world.getUnclaimedZoneSwitch() || world.isUnclaimedZoneIgnoreId(blockId);
        case ITEM_USE:
          return world.getUnclaimedZoneItemUse() || world.isUnclaimedZoneIgnoreId(blockId);
      }
    }

    return false;
  }
  public boolean isTownyAdmin(Player player) {

    return (player.isOp())
        || (plugin.isPermissions() && has(player, PermissionNodes.TOWNY_ADMIN.getNode()));
  }