Sha256: bac08e4a1a40dfc56a799f2748302dd9a9f572b5febbaf913722f1a78b45cb03

Contents?: true

Size: 679 Bytes

Versions: 1

Compression:

Stored size: 679 Bytes

Contents

module CanTango
  class PermissionEngine < Engine
    autoload_modules :Collector, :Compiler, :Evaluator, :Selector
    autoload_modules :Factory, :Loader, :Parser, :Permission
    autoload_modules :RulesParser, :Store, :YamlStore, :Statements, :Statement

    def initialize ability
      super
    end

    def execute!
      puts "permissions"
      permissions.each do |permission|
        permission.evaluate! user
      end
    end

    def permissions
      permission_factory.build!
    end

    protected

    def user
      ability.user
    end

    def permission_factory
      @permission_factory ||= CanTango::PermissionEngine::Factory.new ability
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cantango-0.8.5.1 lib/cantango/permission_engine.rb