Class: Masks::Sessions::Access

Inherits:
Masks::Session show all
Defined in:
app/models/masks/sessions/access.rb

Overview

Session for masking access classes.

Constant Summary

Constants inherited from Masks::Session

Masks::Session::CHECK_KEY

Instance Method Summary collapse

Methods inherited from Masks::Session

#access, #actor=, #checks_for, #cleanup!, #data, #device, #error_message, #extra, #extras, #find_check, #fingerprint, #id, #ip_address, #mask, mask!, #mask!, #params, #passed?, #passed_at, #passed_checks?, #past_checks, #scoped, #session_params, #user_agent, #writable?

Instance Method Details

#matches_mask?(mask) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
22
23
24
# File 'app/models/masks/sessions/access.rb', line 19

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

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