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:
evazion
2020-01-29 20:11:44 -06:00
parent 74d77c1e23
commit 6b066f2cab
15 changed files with 83 additions and 125 deletions

View File

@@ -538,8 +538,4 @@ class Artist < ApplicationRecord
"Deleted"
end
end
def visible?
!is_banned? || CurrentUser.is_gold?
end
end

View File

@@ -4,7 +4,6 @@ class ArtistVersion < ApplicationRecord
belongs_to_updater
belongs_to :artist
delegate :visible?, :to => :artist
module SearchMethods
def search(params)

View File

@@ -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}"

View File

@@ -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)