Fix #4275: Unable to update "banned artist" entries.
Allow all users to view and edit artist entries and wiki pages belonging to banned artists. There was little need to hide these pages from Members, it was mainly to appease artists who didn't like us even linking to their sites. These restrictions also had multiple flaws: * Banned artist information was still visible in the API. * It was still possible to edit banned artists using the API. * It was still possible for unprivileged users to revert banned artist entries or wiki pages to previous versions. * The restrictions were inconsistent: in various places they were either Member-only, Gold-only, or Builder-only.
This commit is contained in:
@@ -538,8 +538,4 @@ class Artist < ApplicationRecord
|
||||
"Deleted"
|
||||
end
|
||||
end
|
||||
|
||||
def visible?
|
||||
!is_banned? || CurrentUser.is_gold?
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,6 @@ class ArtistVersion < ApplicationRecord
|
||||
|
||||
belongs_to_updater
|
||||
belongs_to :artist
|
||||
delegate :visible?, :to => :artist
|
||||
|
||||
module SearchMethods
|
||||
def search(params)
|
||||
|
||||
@@ -244,10 +244,6 @@ class WikiPage < ApplicationRecord
|
||||
TagAlias.to_aliased(titles & tags)
|
||||
end
|
||||
|
||||
def visible?
|
||||
artist.blank? || !artist.is_banned? || CurrentUser.is_builder?
|
||||
end
|
||||
|
||||
def to_param
|
||||
if title =~ /\A\d+\z/
|
||||
"~#{title}"
|
||||
|
||||
@@ -3,7 +3,6 @@ class WikiPageVersion < ApplicationRecord
|
||||
belongs_to :wiki_page
|
||||
belongs_to_updater
|
||||
belongs_to :artist, optional: true
|
||||
delegate :visible?, :to => :wiki_page
|
||||
|
||||
module SearchMethods
|
||||
def search(params)
|
||||
|
||||
Reference in New Issue
Block a user