module Fortress::Mechanism
Mechanism
embbed all the logic of the Fortress
library.
@author zedtux
Public Class Methods
append_or_update(controller_name, key, value)
click to toggle source
# File lib/fortress/mechanism.rb, line 68 def self.append_or_update(controller_name, key, value) authorisations[controller_name] ||= {} if authorisations[controller_name].key?(key) update_authorisations(controller_name, key, value) else append_to_authorisations(controller_name, key, value) end end
parse_options(controller, actions, options)
click to toggle source
# File lib/fortress/mechanism.rb, line 57 def self.parse_options(controller, actions, options) options.each do |key, value| case key when :if Mechanism.authorise_if_truthy(controller.name, value, actions) when :except Mechanism.authorise_excepted(controller.name, value) end end end