OwnershipOverrideChecker
in package
Helper of the privilege matrix (`PrivilegeGroup/edit.latte`): does a grant of a conditional role (`owner`, `receiver`) have any effect for the key? Without an ownership check in the Api presenter, `ALLOW_IF_OWNER` is a fail-closed deny, so the admin disables such a checkbox.
The reflection itself lives in ConditionalRoleSupport (Core), because the server enforces the same rule when saving the matrix and the Api layer must not depend on Admin. This is only a thin admin facade.
Table of Contents
Properties
Methods
- __construct() : mixed
- hasOwnershipOverride() : bool
- Tells whether the Api presenter of the key overrides `verifyOwnership()`; always `false` for keys outside `:Api:`.
- hasReceiverSupport() : bool
- Tells whether the key's presenter can check the receiver (entity with `ReceiverAwareInterface` or its own `isReceiver()`).
- supportsConditionalRole() : bool
- Tells whether the key's presenter can evaluate the conditional role with this code; an unknown role counts as yes (cannot be judged).
Properties
$support read-only
private
ConditionalRoleSupport
$support
= new ConditionalRoleSupport()
Methods
__construct()
public
__construct([ConditionalRoleSupport $support = new ConditionalRoleSupport() ]) : mixed
Parameters
- $support : ConditionalRoleSupport = new ConditionalRoleSupport()
hasOwnershipOverride()
Tells whether the Api presenter of the key overrides `verifyOwnership()`; always `false` for keys outside `:Api:`.
public
hasOwnershipOverride(string $key) : bool
Parameters
- $key : string
Return values
boolhasReceiverSupport()
Tells whether the key's presenter can check the receiver (entity with `ReceiverAwareInterface` or its own `isReceiver()`).
public
hasReceiverSupport(string $key) : bool
Parameters
- $key : string
Return values
boolsupportsConditionalRole()
Tells whether the key's presenter can evaluate the conditional role with this code; an unknown role counts as yes (cannot be judged).
public
supportsConditionalRole(string $roleCode, string $key) : bool
Parameters
- $roleCode : string
- $key : string