Skip to content
Snippets Groups Projects
Commit 4f428400 authored by Kapil Patel's avatar Kapil Patel
Browse files

some changes

parent 4da47779
Branches
Tags
1 merge request!205Do not display depositor for public users
Pipeline #9332 failed
......@@ -7,6 +7,7 @@ class CatalogController < ApplicationController
# This filter applies the hydra access controls
before_action :enforce_show_permissions, only: :show
before_action :restrict_public_user_to_view_depositor
# Allow all search options when in read-only mode
skip_before_action :check_read_only
......@@ -329,4 +330,12 @@ class CatalogController < ApplicationController
def render_bookmarks_control?
false
end
private
def restrict_public_user_to_view_depositor
if current_user.nil?
blacklight_config.index_fields = blacklight_config.index_fields.except('proxy_depositor_ssim', 'depositor_tesim')
end
end
end
<div class="col-md-6">
<div class="metadata">
<dl class="dl-horizontal">
<% doc_presenter = index_presenter(document) %>
<% index_fields = current_user ? index_fields(document) : index_fields(document).except('depositor_tesim', 'proxy_depositor_ssim') %>
<% index_fields.each do |field_name, field| -%>
<% if should_render_index_field? document, field %>
<dt data-solr-field-name="<%= field_name %>"><%= render_index_field_label document, field: field_name %></dt>
<dd><%= doc_presenter.field_value field %></dd>
<% end %>
<% end %>
</dl>
</div>
</div>
<% if document.collection? %>
<% collection_presenter = Hyrax::CollectionPresenter.new(document, current_ability) %>
<div class="col-md-4">
<div class="collection-counts-wrapper">
<div class="collection-counts-item">
<span><%= collection_presenter.total_viewable_collections %></span>Collections
</div>
<div class="collection-counts-item">
<span><%= collection_presenter.total_viewable_works %></span>Works
</div>
</div>
</div>
<% end %>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment