module ActionBouncer
Constants
- VERSION
Public Class Methods
allow(resource, options)
click to toggle source
# File lib/action_bouncer.rb, line 7 def self.allow(resource, options) @_allowances ||= [] @_allowances << Allowance.new(resource, options) end
included(klass)
click to toggle source
# File lib/action_bouncer.rb, line 5 def self.included(klass) klass.class_eval do def self.allow(resource, options) @_allowances ||= [] @_allowances << Allowance.new(resource, options) end def self._authorization Authorization.new(@_allowances) end before_action { self.class._authorization.try(:authorize!, self) } end end