Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
RDMS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
researchdata
RDMS
Commits
4f428400
Commit
4f428400
authored
1 year ago
by
Kapil Patel
Browse files
Options
Downloads
Patches
Plain Diff
some changes
parent
4da47779
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!205
Do not display depositor for public users
Pipeline
#9332
failed
1 year ago
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hyrax/app/controllers/catalog_controller.rb
+9
-0
9 additions, 0 deletions
hyrax/app/controllers/catalog_controller.rb
hyrax/app/views/catalog/_index_list_default.html.erb
+0
-28
0 additions, 28 deletions
hyrax/app/views/catalog/_index_list_default.html.erb
with
9 additions
and
28 deletions
hyrax/app/controllers/catalog_controller.rb
+
9
−
0
View file @
4f428400
...
...
@@ -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
This diff is collapsed.
Click to expand it.
hyrax/app/views/catalog/_index_list_default.html.erb
deleted
100644 → 0
+
0
−
28
View file @
4da47779
<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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment