diff --git a/app/models/artist.rb b/app/models/artist.rb index 2b5932d25..24e980308 100644 --- a/app/models/artist.rb +++ b/app/models/artist.rb @@ -495,6 +495,10 @@ class Artist < ActiveRecord::Base user.is_builder? end + def editable_by?(user) + user.is_builder? || (!is_banned? && is_active?) + end + def visible? !is_banned? || CurrentUser.is_gold? end diff --git a/app/views/artists/edit.html.erb b/app/views/artists/edit.html.erb index 18409448f..64c451061 100644 --- a/app/views/artists/edit.html.erb +++ b/app/views/artists/edit.html.erb @@ -2,14 +2,15 @@

Edit Artist

- <% if !@artist.is_active? %> + <% if @artist.editable_by?(CurrentUser.user) %> + <%= render "form" %> + + <% elsif !@artist.is_active? %>

This artist entry is inactive and cannot be edited.

<% elsif @artist.is_banned? %>

The artist requested removal of this page.

- <% else %> - <%= render "form" %> <% end %>