module ActionPolicy

ActionPolicy is an authorization framework for Ruby/Rails applications.

It provides a way to write access policies and helpers to check these policies in your application.

Constants

VERSION

Attributes

cache_store[RW]
enforce_predicate_rules_naming[RW]

Public Class Methods

lookup(target, allow_nil: false, default: nil, **options) click to toggle source

Find a policy class for a target

# File lib/action_policy.rb, line 40
def lookup(target, allow_nil: false, default: nil, **options)
  LookupChain.call(target, **options) ||
    default ||
    (allow_nil ? nil : raise(NotFound, target))
end