Sha256: 7df5cd85fc86607be300e7b0be8b8c28dfea63932f5fd970c4141f9740052752

Contents?: true

Size: 406 Bytes

Versions: 21

Compression:

Stored size: 406 Bytes

Contents

module CanTango
  class PermissionEngine < Engine
    module Selector
      class Licenses < Base
        attr_reader :roles, :role_groups

        def initialize subject
          @roles  = subject.roles_list
          @role_groups = subject.role_groups_list
        end

        def relevant? permission
          (roles | role_groups).include? permission.to_sym
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
cantango-0.9.4.7 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.9.4.6 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.9.4.5 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.9.4.3 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.9.4.2 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.9.4.1 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.9.4 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.9.3.2 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.8.9.5 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.8.9.4 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.8.9.3 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.8.9.2 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.8.9.1 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.8.9 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.8.8.1 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.8.8 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.8.7 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.8.6.2 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.8.6.1 lib/cantango/permission_engine/selector/licenses.rb
cantango-0.8.6 lib/cantango/permission_engine/selector/licenses.rb