Sha256: 5d0530e07673062c98dba99adbdcb3a2fbc1fddbeea1095838728846159a419a

Contents?: true

Size: 395 Bytes

Versions: 1

Compression:

Stored size: 395 Bytes

Contents

module CanTango
  module PermissionEngine
    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 valid? permission
          (roles | role_groups).include? permission.to_sym
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cantango-0.8.0 lib/cantango/permission_engine/selector/licenses.rb