fixes #1672
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
class ArtistsController < ApplicationController
|
||||
respond_to :html, :xml, :json
|
||||
before_filter :member_only, :except => [:index, :show, :banned]
|
||||
before_filter :builder_only, :only => [:edit_name, :update_name, :destroy]
|
||||
before_filter :admin_only, :only => [:ban]
|
||||
before_filter :builder_only, :only => [:edit_name, :update_name]
|
||||
|
||||
def new
|
||||
@artist = Artist.new_with_defaults(params)
|
||||
@@ -82,6 +82,24 @@ class ArtistsController < ApplicationController
|
||||
respond_with(@artist)
|
||||
end
|
||||
|
||||
def destroy
|
||||
@artist = Artist.find(params[:id])
|
||||
if !@artist.deletable_by?(CurrentUser.user)
|
||||
raise User::PrivilegeError
|
||||
end
|
||||
@artist.update_attribute(:is_active, false)
|
||||
respond_with(@artist, :notice => "Artist deleted")
|
||||
end
|
||||
|
||||
def undelete
|
||||
@artist = Artist.find(params[:id])
|
||||
if !@artist.deletable_by?(CurrentUser.user)
|
||||
raise User::PrivilegeError
|
||||
end
|
||||
@artist.update_attribute(:is_active, true)
|
||||
respond_with(@artist, :notice => "Artist undeleted")
|
||||
end
|
||||
|
||||
def revert
|
||||
@artist = Artist.find(params[:id])
|
||||
@version = ArtistVersion.find(params[:version_id])
|
||||
|
||||
Reference in New Issue
Block a user