Sha256: a1e3d3314d0bc9604945a7a2e826cfa4418f71f228205a92928325e97075de3a

Contents?: true

Size: 930 Bytes

Versions: 1

Compression:

Stored size: 930 Bytes

Contents

module Authority
  class Configuration

    # Has default settings, overrideable in the initializer.

    attr_accessor :abilities, :controller_action_map, :user_method, :security_violation_handler, :logger

    def initialize

      @abilities = {
        :create => 'creatable',
        :read   => 'readable',
        :update => 'updatable',
        :delete => 'deletable'
      }

      @controller_action_map = {
        :index   => 'read',
        :show    => 'read',
        :new     => 'create',
        :create  => 'create',
        :edit    => 'update',
        :update  => 'update',
        :destroy => 'delete'
      }

      @user_method = :current_user

      @security_violation_handler = :authority_forbidden

      @logger = Logger.new(STDERR)
    end

    def default_strategy=(val)
      raise ArgumentError, "`config.default_strategy=` was removed in Authority 2.0; see README and CHANGELOG"
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
authority-2.0.0 lib/authority/configuration.rb