Sha256: 9a7d287a120c35bad15551487f5577739d900a90056ba449391d6a6752c3bdb0

Contents?: true

Size: 941 Bytes

Versions: 23

Compression:

Stored size: 941 Bytes

Contents

module Authority
  class Configuration

    # Has default settings, which can be overridden 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

23 entries across 23 versions & 1 rubygems

Version Path
authority-3.3.0 lib/authority/configuration.rb
authority-3.2.2 lib/authority/configuration.rb
authority-3.2.1 lib/authority/configuration.rb
authority-3.2.0 lib/authority/configuration.rb
authority-3.1.0 lib/authority/configuration.rb
authority-3.0.0 lib/authority/configuration.rb
authority-2.10.0 lib/authority/configuration.rb
authority-2.9.0 lib/authority/configuration.rb
authority-2.8.1 lib/authority/configuration.rb
authority-2.8.0 lib/authority/configuration.rb
authority-2.7.0 lib/authority/configuration.rb
authority-2.6.0 lib/authority/configuration.rb
authority-2.5.0 lib/authority/configuration.rb
authority-2.4.3 lib/authority/configuration.rb
authority-2.4.2 lib/authority/configuration.rb
authority-2.4.1 lib/authority/configuration.rb
authority-2.4.0 lib/authority/configuration.rb
authority-2.3.2 lib/authority/configuration.rb
authority-2.3.1 lib/authority/configuration.rb
authority-2.3.0 lib/authority/configuration.rb