module ActionPolicy::Railtie::Config

Provides Rails-specific configuration, accessible through `Rails.application.config.action_policy`

Attributes

auto_inject_into_channel[RW]

Define whether we need to include ActionCable::Channel::Base with the default authorization logic

auto_inject_into_controller[RW]

Define whether we need to extend ApplicationController::Base with the default authorization logic

channel_authorize_current_user[RW]

Define whether we want to specify `current_user` as the default authorization context in channels

controller_authorize_current_user[RW]

Define whether we want to specify `current_user` as the default authorization context in controller

instrumentation_enabled[RW]

Define whether to include instrumentation functionality. Enabled by default.

namespace_cache_enabled[RW]

Define whether to cache namespaced policy resolution result (e.g. in controllers). Enabled only in production by default.

Public Class Methods

cache_store=(store) click to toggle source
# File lib/action_policy/railtie.rb, line 37
def cache_store=(store)
  # Handle both:
  #   store = :memory
  #   store = :mem_cache, ENV['MEMCACHE']
  if store.is_a?(Symbol) || store.is_a?(Array)
    store = ActiveSupport::Cache.lookup_store(store)
  end

  ActionPolicy.cache_store = store
end