From a084da2dbe460e0081f3f3163082e61110386dc2 Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 22 Dec 2020 02:15:21 -0600 Subject: [PATCH] artists: hide other names of banned artists on index page. Don't show other names of banned artists on the /artists page to anonymous users. Hides potentially sensitive information from Google and logged out users. --- app/views/artists/index.html.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/artists/index.html.erb b/app/views/artists/index.html.erb index ed8edf733..4b16fcaf7 100644 --- a/app/views/artists/index.html.erb +++ b/app/views/artists/index.html.erb @@ -13,8 +13,10 @@ <% end %> <% end %> <% t.column "Other Names", td: {class: "col-expand"} do |artist| %> - <% artist.other_names.each do |name| %> - <%= link_to name, artists_path(search: { any_name_matches: name }), class: "artist-other-name", rel: "nofollow" %> + <% unless artist.is_banned? && !policy(artist).can_view_banned? %> + <% artist.other_names.each do |name| %> + <%= link_to name, artists_path(search: { any_name_matches: name }), class: "artist-other-name", rel: "nofollow" %> + <% end %> <% end %> <% end %> <% t.column "Status" do |artist| %>