Sha256: 503639747bdef6da5df6f635b650d5c6958fdcff1a550436abb50fb593b92035

Contents?: true

Size: 655 Bytes

Versions: 8

Compression:

Stored size: 655 Bytes

Contents

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

8 entries across 8 versions & 1 rubygems

Version Path
rails-auth-2.1.4 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-2.1.3 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-2.1.2 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-2.1.1 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-2.1.0 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-2.0.3 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-2.0.2 lib/rails/auth/acl/matchers/allow_all.rb
rails-auth-2.0.1 lib/rails/auth/acl/matchers/allow_all.rb