Sha256: 36b6a9dd394e300c46a01e3c28c5695ef1b88a0a86e95c055e0b5bf61b2eb928

Contents?: true

Size: 478 Bytes

Versions: 3

Compression:

Stored size: 478 Bytes

Contents

# frozen_string_literal: true

module WmsRewriteConcern
  extend Geoblacklight::SolrDocument

  def viewer_endpoint
    if local_restricted?
      # replace wms prefix with cas authed proxy
      super.gsub(Settings.INSTITUTION_GEOSERVER_URL, Settings.PROXY_GEOSERVER_URL)
    else
      super
    end
  end

  def local_restricted?
    local? && restricted?
  end

  def local?
    fetch(Settings.FIELDS.PROVENANCE, "").casecmp(Settings.INSTITUTION_LOCAL_NAME).zero?
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
geoblacklight_sidecar_images-0.9.2 app/models/concerns/wms_rewrite_concern.rb
geoblacklight_sidecar_images-0.9.1 app/models/concerns/wms_rewrite_concern.rb
geoblacklight_sidecar_images-0.9.0 app/models/concerns/wms_rewrite_concern.rb