Module: Bizside::Acl::ControllerHelper

Includes:
AvailableHelper
Defined in:
lib/bizside/acl/controller_helper.rb

Instance Method Summary collapse

Methods included from AvailableHelper

#available_for

Instance Method Details

#authorize_user!Object



6
7
8
9
10
11
12
13
14
# File 'lib/bizside/acl/controller_helper.rb', line 6

def authorize_user!
  return if available_for(params[:controller], params[:action], params)

  if request.xhr?
    head :forbidden
  else
    redirect_to root_path
  end
end