module Barristan

Constants

VERSION

Public Instance Methods

guard(resource, action, user) { |guarded = guarded| ... } click to toggle source
# File lib/barristan.rb, line 3
def guard(resource, action, user)
  yield(guarded = Guarded.new)
  Can.new(resource, action, user).
    able? ? guarded.authorized! : guarded.forbidden!
end