Class: Constraints::AdminConstrainer

Inherits:
Object
  • Object
show all
Defined in:
lib/constraints/admin_constrainer.rb

Instance Method Summary collapse

Instance Method Details

#matches?(request) ⇒ Boolean

Returns:

  • (Boolean)

5
6
7
8
9
10
11
# File 'lib/constraints/admin_constrainer.rb', line 5

def matches?(request)
  if Feature.enabled?(:user_mode_in_session)
    admin_mode_enabled?(request)
  else
    user_is_admin?(request)
  end
end