Sha256: d48c9a8045052b86bbe84d115992d3402f5f628b0d03b4eaba087b0566a5c2a7

Contents?: true

Size: 651 Bytes

Versions: 8

Compression:

Stored size: 651 Bytes

Contents

class Manage::BaseController < ApplicationController
  before_filter :authenticate_user!
  check_authorization
  
  layout "manage"
  respond_to :html
  
  protected
  
    rescue_from CanCan::AccessDenied do |exception|
      flash[:failure] = exception.message
      flash[:failure] ||= I18n.t(:access_denied, :scope => [:flash, :users])
            
      respond_to do |format|
        format.html { redirect_to new_session_path(:user) }
        format.xml  { head :unauthorized }
        format.js   { head :unauthorized }
      end
    end
    
    def current_ability
      @current_ability ||= ::Ability.new(current_user, :manage)
    end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
sunrise-core-0.1.5 app/controllers/manage/base_controller.rb
sunrise-core-0.1.4 app/controllers/manage/base_controller.rb
sunrise-core-0.1.3 app/controllers/manage/base_controller.rb
sunrise-core-0.1.2 app/controllers/manage/base_controller.rb
sunrise-core-0.1.1 app/controllers/manage/base_controller.rb
sunrise-core-0.1.0 app/controllers/manage/base_controller.rb
freeberry-0.3.0 app/controllers/manage/base_controller.rb
freeberry-0.2.9 app/controllers/manage/base_controller.rb