Sha256: fe6f526a4c2e3ea656615751d49ee7f2071db4c3c1cc6a062136f68af6014865

Contents?: true

Size: 576 Bytes

Versions: 4

Compression:

Stored size: 576 Bytes

Contents

# frozen_string_literal: true

module Masks
  module Sessions
    # Session for masking access classes.
    class Access < Masks::Session
      attribute :name
      attribute :original

      delegate :actor,
               :config,
               :params,
               :data,
               :writable?,
               :extras,
               :extra,
               to: :original

      def matches_mask?(mask)
        return false unless mask.access == name.to_s

        original.mask.access&.try(:include?, name.to_s) || original.mask.access
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
masks-0.3.2 app/models/masks/sessions/access.rb
masks-0.3.1 app/models/masks/sessions/access.rb
masks-0.3.0 app/models/masks/sessions/access.rb
masks-0.2.0 app/models/masks/sessions/access.rb