Sha256: d59ce3d38a5fdf4de54e6ddac6e266181a4981a67a119581bcbdc2b024c55cce

Contents?: true

Size: 687 Bytes

Versions: 6

Compression:

Stored size: 687 Bytes

Contents

# frozen_string_literal: true

module Rails
  module Auth
    class ACL
      # Built-in matchers
      module Matchers
        # Allows unauthenticated clients to access to a given resource
        class AllowAll
          def initialize(enabled)
            raise ArgumentError, "enabled must be true/false" unless [true, false].include?(enabled)

            @enabled = enabled
          end

          def match(_env)
            @enabled
          end

          # Generates inspectable attributes for debugging
          #
          # @return [true, false] is the matcher enabled?
          def attributes
            @enabled
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails-auth-3.2.0 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-3.1.0 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-3.0.0 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-2.2.2 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-2.2.1 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-2.2.0 lib/rails/auth/acl/matchers/allow_all.rb