posts: show takedown page for banned artists and posts.
Show a "This page has been removed because of a takedown request" error when an unauthorized user searches for a banned tag, or tries to view a banned post.
This commit is contained in:
@@ -31,6 +31,7 @@ class WikiPagesController < ApplicationController
|
||||
|
||||
def show
|
||||
@wiki_page, found_by = WikiPage.find_by_id_or_title(params[:id])
|
||||
raise PageRemovedError if request.format.html? && @wiki_page&.artist.present? && @wiki_page.artist.is_banned? && !policy(@wiki_page.artist).can_view_banned?
|
||||
|
||||
if request.format.html? && @wiki_page.blank? && found_by == :title
|
||||
@wiki_page = WikiPage.new(title: params[:id])
|
||||
|
||||
Reference in New Issue
Block a user