Skip to content
This repository was archived by the owner on Mar 24, 2020. It is now read-only.

Commit 1eb1929

Browse files
committed
Merge branch 'release/1.80' into develop
2 parents 44bc893 + ea730e7 commit 1eb1929

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

app/controllers/dams_resource_controller.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ def show
4040
# generate facet collection list for collection page only
4141
models = @document["active_fedora_model_ssi"]
4242
if models.include?("DamsAssembledCollection") || models.include?("DamsProvenanceCollection") || models.include?("DamsProvenanceCollectionPart")
43-
other_rights_query = "(otherRights_tesim:localDisplay OR otherRights_tesim:metadataDisplay) AND collections_tesim:#{params[:id]}"
44-
@res, @doc = get_search_results(q: other_rights_query, rows: 1)
45-
@metadata_only = !@res.response['numFound'].zero?
43+
other_rights_fquery = "(otherRights_tesim:localDisplay OR otherRights_tesim:metadataDisplay)"
44+
collection_solr_params = { :q => "collections_tesim:#{params[:id]}", :fq => other_rights_fquery, :rows => 1 }
45+
collection_response, collection_documents = get_search_results(collection_solr_params, :spellcheck => "false")
46+
@metadata_only = !collection_response.response['numFound'].zero?
4647

4748
facet_collection_params = { :f=>{"collection_sim"=>"#{@document['title_tesim'].first.to_s}"}, :id=>params[:id], :rows => 0 }
4849
apply_gated_discovery( facet_collection_params, nil )
@@ -73,8 +74,7 @@ def show
7374
end
7475

7576
# enforce access controls
76-
if can? :show, @document
77-
77+
if can?(:show, @document) || @document['discover_access_group_ssim'].include?("public")
7878
# find related resources
7979
collectionData = @document["collection_json_tesim"]
8080
@collectionDocArray = Array.new
@@ -106,7 +106,7 @@ def show
106106
end
107107
elsif @document['discover_access_group_ssim'].include?("public")
108108
respond_to do |format|
109-
format.html { render :metadata }
109+
format.html
110110
format.json { render json: @document }
111111
format.rdf { render xml: @rdfxml }
112112
format.nt { rdf_nt }

spec/features/dams_collections_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@
353353
@copyright = DamsCopyright.create status: 'Under copyright'
354354
@metadataOnlyObj = DamsObject.create titleValue: 'Test Object with metadataOnly Display', provenanceCollectionURI: @metadataOnlyCollection.pid, copyrightURI: @copyright.pid, otherRightsURI: @metadataDisplay.pid
355355
@localObj = DamsObject.create titleValue: 'Test Object with localDisplay', provenanceCollectionURI: @localOnlyCollection.pid, copyrightURI: @copyright.pid, otherRightsURI: @localDisplay.pid
356-
@obj = DamsObject.create titleValue: 'Test Object with no localDisplay, no metadataOnlyDisplay', provenanceCollectionURI: @localOnlyCollection.pid, copyrightURI: @copyright.pid
356+
@obj = DamsObject.create titleValue: 'Test Object with no localDisplay, no metadataOnlyDisplay', provenanceCollectionURI: @collection.pid, copyrightURI: @copyright.pid
357357
solr_index @localDisplay.pid
358358
solr_index @metadataDisplay.pid
359359
solr_index @metadataOnlyCollection.pid

0 commit comments

Comments
 (0)