Sha256: ea7d40568c0383c370c407a12cee46f704144817a88d37d3b319d83daf9ea1dc

Contents?: true

Size: 665 Bytes

Versions: 10

Compression:

Stored size: 665 Bytes

Contents

module Rails
  module Auth
    class ACL
      # Built-in predicate 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

10 entries across 10 versions & 1 rubygems

Version Path
rails-auth-1.3.0 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-1.2.0 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-1.1.0 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-1.0.0 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-0.5.3 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-0.5.2 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-0.5.1 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-0.5.0 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-0.4.1 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-0.4.0 lib/rails/auth/acl/matchers/allow_all.rb