Sha256: 44bd8b2d37ea1c82493019e1ddec4e818d652ecef902ff8fdeff3bb80fc7e120
Contents?: true
Size: 804 Bytes
Versions: 7
Compression:
Stored size: 804 Bytes
Contents
module CanTango module Ability class Base include CanCan::Ability include CanTango::Ability::Rules attr_reader :candidate, :options # Equivalent to a CanCan Ability#initialize call # which executes all the permission logic def initialize candidate, options = {} raise "Candidate must be something!" if !candidate @candidate, @options = candidate, options execute end def execute clear_rules! calculate_rules end def session @session ||= options[:session] || {} # seperate session cache for each type of user? end # Helper.modules.each do |name| # include "CanTango::Ability::Helper::#{name.to_s.camelize}".constantize # end end end end
Version data entries
7 entries across 7 versions & 1 rubygems