Module: Umpire

Defined in:
lib/umpire/policy.rb,
lib/umpire.rb,
lib/umpire/version.rb,
lib/umpire/auth_helper.rb,
lib/umpire/policy_missing_error.rb

Overview

A very basic policy class. Extend other policies with this by providing a rules method which returns the valid actions based on the subject and object

Usage

with a single action: DrivingPolicy.allows?(driver).to(:drive, car)

with multiple actions MemberPolicy.allows?(member).to([:join, :leave], club)

without object SchoolPolicy.allows?(student).to(:cheat_on_exam)

Defined Under Namespace

Modules: AuthHelper Classes: NoRulesFound, Policy, PolicyMissingError

Constant Summary collapse

VERSION =
"0.4.0"