This commit is contained in:
Toks
2013-06-30 11:57:30 -04:00
parent 51a7e36509
commit 2016e15ce8
9 changed files with 6 additions and 15 deletions

View File

@@ -48,11 +48,11 @@ class AdvertisementsController < ApplicationController
redirect_to advertisements_path, :notice => "Advertisement destroyed"
end
private
def advertiser_only
if !Danbooru.config.is_user_advertiser?(CurrentUser.user)
redirect_to "/static/access_denied"
return false
end
private
def advertiser_only
if !Danbooru.config.is_user_advertiser?(CurrentUser.user)
raise User::PrivilegeError
return false
end
end
end

View File

@@ -1,7 +1,6 @@
class CommentsController < ApplicationController
respond_to :html, :xml, :json
before_filter :member_only, :only => [:update, :create, :edit, :destroy]
rescue_from User::PrivilegeError, :with => "static/access_denied"
rescue_from ActiveRecord::StatementInvalid, :with => :search_error
def index
@@ -106,7 +105,6 @@ private
end
protected
def search_error(e)
if e.message =~ /syntax error in tsquery/
@error_message = "Meta-tags are not supported in comment searches by tag"

View File

@@ -1,7 +1,6 @@
class ForumPostsController < ApplicationController
respond_to :html, :xml, :json, :js
before_filter :member_only, :except => [:index, :show]
rescue_from User::PrivilegeError, :with => "static/access_denied"
def new
@forum_topic = ForumTopic.find(params[:topic_id]) if params[:topic_id]

View File

@@ -3,7 +3,6 @@ class ForumTopicsController < ApplicationController
before_filter :member_only, :except => [:index, :show]
before_filter :normalize_search, :only => :index
after_filter :update_last_forum_read_at, :only => [:show]
rescue_from User::PrivilegeError, :with => "static/access_denied"
def new
@forum_topic = ForumTopic.new

View File

@@ -2,7 +2,6 @@ class PoolsController < ApplicationController
respond_to :html, :xml, :json, :js
before_filter :member_only, :except => [:index, :show]
before_filter :moderator_only, :only => [:destroy]
rescue_from User::PrivilegeError, :with => "static/access_denied"
def new
@pool = Pool.new

View File

@@ -1,7 +1,6 @@
class PostAppealsController < ApplicationController
before_filter :member_only
respond_to :html, :xml, :json, :js
rescue_from User::PrivilegeError, :with => "static/access_denied"
def new
@post_appeal = PostAppeal.new

View File

@@ -1,7 +1,6 @@
class PostFlagsController < ApplicationController
before_filter :member_only
respond_to :html, :xml, :json, :js
rescue_from User::PrivilegeError, :with => "static/access_denied"
def new
@post_flag = PostFlag.new

View File

@@ -1,7 +1,6 @@
class TagSubscriptionsController < ApplicationController
before_filter :member_only, :only => [:new, :edit, :create, :update, :destroy]
respond_to :html, :xml, :json
rescue_from User::PrivilegeError, :with => "static/access_denied"
def new
@tag_subscription = TagSubscription.new

View File

@@ -1,7 +1,6 @@
class UserFeedbacksController < ApplicationController
before_filter :gold_only, :only => [:new, :edit, :create, :update, :destroy]
respond_to :html, :xml, :json
rescue_from User::PrivilegeError, :with => "static/access_denied"
def new
@user_feedback = UserFeedback.new(params[:user_feedback])