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)


8
9
10
11
# File 'lib/rails/auth/acl/matchers/allow_all.rb', line 8

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?



20
21
22
# File 'lib/rails/auth/acl/matchers/allow_all.rb', line 20

def attributes
  @enabled
end

#match(_env) ⇒ Object



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

def match(_env)
  @enabled
end