Class: Yes::Core::Authorization::ReadModelAuthorizer Abstract

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

Overview

This class is abstract.

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

a custom authorizer.

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.call(_record, _auth_data) ⇒ Boolean

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

Parameters:

  • record (ApplicationRecord)

    record to authorize

  • auth_data (Hash)

    authorization data

Returns:

  • (Boolean)

    true if read model is authorized

Raises:



16
17
18
# File 'lib/yes/core/authorization/read_model_authorizer.rb', line 16

def self.call(_record, _auth_data)
  raise NotAuthorized
end