Class: PactBroker::Diagnostic::Resources::BaseResource

Inherits:
Webmachine::Resource
  • Object
show all
Includes:
Api::Resources::Authentication
Defined in:
lib/pact_broker/diagnostic/resources/base_resource.rb

Direct Known Subclasses

Dependencies, Heartbeat

Instance Method Summary collapse

Methods included from Api::Resources::Authentication

#authenticated?

Instance Method Details

#forbidden?Boolean

Returns:

  • (Boolean)


15
16
17
18
# File 'lib/pact_broker/diagnostic/resources/base_resource.rb', line 15

def forbidden?
  return false if PactBroker.configuration.authorize.nil?
  !PactBroker.configuration.authorize.call(self, {})
end

#is_authorized?(authorization_header) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/pact_broker/diagnostic/resources/base_resource.rb', line 11

def is_authorized?(authorization_header)
  authenticated?(self, authorization_header)
end