Class: Hecks::Runtime::Caller::Current

Inherits:
Struct
  • Object
show all
Defined in:
lib/hecks/runtime/caller.rb

Overview

actor_id is OPTIONAL, on top of the role that has always been here — a caller that states only a role (every caller before this) is checked the way it always was, string equality against the command's own role. A caller that also names WHO it is lets CommandRules::Authorization check a real Governance RoleAssignment instead, once the command's domain has Governance attached — see that module's own header for the full split.

as_of and scope are BOTH optional too, and both self-asserted by the caller rather than derived from the command — deliberately: as_of is filled at the door from Ports::Clock.now, never inside the interpreter (see Ports::Clock's own header), so there is no other place to source it from. scope stays here rather than becoming a command-level DSL construct on purpose — a scope check that lived in the bluebook would put an authorization concern inside the domain declaration itself; this keeps it an application-boundary fact instead, the same shape role/actor_id already are. The tradeoff: a caller states what scope it is acting in, and holds_role? verifies a live grant exists for THAT scope — it does not independently confirm the scope matches whatever the command's own target data belongs to.

Instance Attribute Summary collapse

Instance Attribute Details

#actor_idObject

Returns the value of attribute actor_id

Returns:

  • (Object)

    the current value of actor_id



36
37
38
# File 'lib/hecks/runtime/caller.rb', line 36

def actor_id
  @actor_id
end

#as_ofObject

Returns the value of attribute as_of

Returns:

  • (Object)

    the current value of as_of



36
37
38
# File 'lib/hecks/runtime/caller.rb', line 36

def as_of
  @as_of
end

#roleObject

Returns the value of attribute role

Returns:

  • (Object)

    the current value of role



36
37
38
# File 'lib/hecks/runtime/caller.rb', line 36

def role
  @role
end

#scopeObject

Returns the value of attribute scope

Returns:

  • (Object)

    the current value of scope



36
37
38
# File 'lib/hecks/runtime/caller.rb', line 36

def scope
  @scope
end