diff --git a/hyrax/app/helpers/hyrax_helper.rb b/hyrax/app/helpers/hyrax_helper.rb index 06a26fcb58fe5b9554299411dc1747d3e38cdc23..a56140a5d87bc60a5b0333b843e0147bbc01e517 100644 --- a/hyrax/app/helpers/hyrax_helper.rb +++ b/hyrax/app/helpers/hyrax_helper.rb @@ -219,8 +219,10 @@ module HyraxHelper template = ERB.new file_contents parsed_file = YAML.load(template.result(binding)) parsed_file['collections_to_display'].each do |collection_name| - c = Collection.where(title: collection_name).first - collections_to_display.append({id: c.id, title: c.title&.first, url: "/dashboard/collections/#{c.id}"}) + collection = Collection.where(title: collection_name).first + next unless can? :read, collection + + collections_to_display.append({id: collection.id, title: collection.title&.first, url: "/dashboard/collections/#{collection.id}"}) # collections_to_display.append({id: c.id, title: c.title&.first, url: dashboard_collection_path(c.id)}) end collections_to_display