fixes #2417
This commit is contained in:
@@ -145,4 +145,8 @@ protected
|
||||
Rails.application.config.session_store :cookie_store, :key => '_danbooru_session', :secure => false
|
||||
end
|
||||
end
|
||||
|
||||
def post_approvers_only
|
||||
CurrentUser.can_approve_posts?
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class ForumTopicsController < ApplicationController
|
||||
respond_to :html, :xml, :json
|
||||
before_filter :member_only, :except => [:index, :show]
|
||||
before_filter :janitor_only, :only => [:new_merge, :create_merge]
|
||||
before_filter :moderator_only, :only => [:new_merge, :create_merge]
|
||||
before_filter :normalize_search, :only => :index
|
||||
|
||||
def new
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class IpBansController < ApplicationController
|
||||
before_filter :janitor_only
|
||||
before_filter :moderator_only
|
||||
|
||||
def new
|
||||
@ip_ban = IpBan.new
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Moderator
|
||||
class DashboardsController < ApplicationController
|
||||
before_filter :janitor_only
|
||||
before_filter :moderator_only
|
||||
helper :post_flags, :post_appeals
|
||||
|
||||
def show
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Moderator
|
||||
class IpAddrsController < ApplicationController
|
||||
before_filter :janitor_only
|
||||
before_filter :moderator_only
|
||||
|
||||
def index
|
||||
@search = IpAddrSearch.new(params[:search])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module Moderator
|
||||
module Post
|
||||
class ApprovalsController < ApplicationController
|
||||
before_filter :janitor_only
|
||||
before_filter :post_approvers_only
|
||||
|
||||
def create
|
||||
@post = ::Post.find(params[:post_id])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module Moderator
|
||||
module Post
|
||||
class DisapprovalsController < ApplicationController
|
||||
before_filter :janitor_only
|
||||
before_filter :post_approvers_only
|
||||
|
||||
def create
|
||||
@post = ::Post.find(params[:post_id])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module Moderator
|
||||
module Post
|
||||
class PostsController < ApplicationController
|
||||
before_filter :janitor_only, :only => [:delete, :undelete, :ban, :unban, :confirm_delete, :confirm_ban]
|
||||
before_filter :moderator_only, :only => [:delete, :undelete, :ban, :unban, :confirm_delete, :confirm_ban]
|
||||
before_filter :admin_only, :only => [:expunge]
|
||||
rescue_from ::PostFlag::Error, :with => :rescue_exception
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ module Moderator
|
||||
module Post
|
||||
class QueuesController < ApplicationController
|
||||
respond_to :html, :json
|
||||
before_filter :janitor_only
|
||||
before_filter :post_approvers_only
|
||||
|
||||
def show
|
||||
::Post.without_timeout do
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class PoolsController < ApplicationController
|
||||
respond_to :html, :xml, :json, :js
|
||||
before_filter :member_only, :except => [:index, :show, :gallery]
|
||||
before_filter :janitor_only, :only => [:destroy]
|
||||
before_filter :moderator_only, :only => [:destroy]
|
||||
|
||||
def new
|
||||
@pool = Pool.new
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class TagAliasCorrectionsController < ApplicationController
|
||||
before_filter :janitor_only
|
||||
before_filter :builder_only
|
||||
|
||||
def create
|
||||
@correction = TagAliasCorrection.new(params[:tag_alias_id])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class WikiPagesController < ApplicationController
|
||||
respond_to :html, :xml, :json, :js
|
||||
before_filter :member_only, :except => [:index, :show, :show_or_new]
|
||||
before_filter :janitor_only, :only => [:destroy]
|
||||
before_filter :moderator_only, :only => [:destroy]
|
||||
before_filter :normalize_search_params, :only => [:index]
|
||||
rescue_from ActiveRecord::StatementInvalid, :with => :rescue_exception
|
||||
rescue_from ActiveRecord::RecordNotFound, :with => :rescue_exception
|
||||
|
||||
Reference in New Issue
Block a user