Class: Yes::Core::Authorization::ReadRequestAuthorizer Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/yes/core/authorization/read_request_authorizer.rb

Overview

This class is abstract.

Read request authorizer base class. Subclass and override call method to implement

a custom authorizer.

Direct Known Subclasses

ReadRequestCerbosAuthorizer

Constant Summary collapse

NotAuthorized =
Class.new(Yes::Core::Error)

Class Method Summary collapse

Class Method Details

.call(_params, _auth_data) ⇒ Boolean

Implement this method to authorize a read request. Needs to return true if read request is authorized, otherwise raise NotAuthorized.

Parameters:

  • params (Hash)

    request params to authorize

  • auth_data (Hash)

    authorization data

Returns:

  • (Boolean)

    true if read request is authorized raises NotAuthorized otherwise

Raises:



17
18
19
# File 'lib/yes/core/authorization/read_request_authorizer.rb', line 17

def call(_params, _auth_data)
  raise NotAuthorized
end