Class: Rails::Auth::ACL::Matchers::AllowAll

Inherits:
Object
  • Object
show all
Defined in:
lib/rails/auth/acl/matchers/allow_all.rb

Overview

Allows unauthenticated clients to access to a given resource

Instance Method Summary collapse

Constructor Details

#initialize(enabled) ⇒ AllowAll

Returns a new instance of AllowAll.

Raises:

  • (ArgumentError)


10
11
12
13
14
# File 'lib/rails/auth/acl/matchers/allow_all.rb', line 10

def initialize(enabled)
  raise ArgumentError, "enabled must be true/false" unless [true, false].include?(enabled)

  @enabled = enabled
end

Instance Method Details

#attributestrue, false

Generates inspectable attributes for debugging

Returns:

  • (true, false)

    is the matcher enabled?



23
24
25
# File 'lib/rails/auth/acl/matchers/allow_all.rb', line 23

def attributes
  @enabled
end

#match(_env) ⇒ Object



16
17
18
# File 'lib/rails/auth/acl/matchers/allow_all.rb', line 16

def match(_env)
  @enabled
end