AccessService
Corex\Config\Access\AccessService · class · Config layer
Orchestrates previewed role changes and terminal access-request decisions.
Public API
Section titled “Public API”__construct(CorexAbilityCatalog $catalog, AccessPolicy $policy, RoleAbilityStore $roleAbilities, AccessRequestStore $requests, AccessUserDirectory $users, ActivityService $activity, RequestableAbilities $requestable, ?RoutedMailer $notifications, ?EventDispatcher $events)
Section titled “__construct(CorexAbilityCatalog $catalog, AccessPolicy $policy, RoleAbilityStore $roleAbilities, AccessRequestStore $requests, AccessUserDirectory $users, ActivityService $activity, RequestableAbilities $requestable, ?RoutedMailer $notifications, ?EventDispatcher $events)”previewRoleChanges(int $actorId, string $roleKey, array $changes): AccessChangePreview
Section titled “previewRoleChanges(int $actorId, string $roleKey, array $changes): AccessChangePreview”roleChangeHash(string $roleKey, array $changes): string
Section titled “roleChangeHash(string $roleKey, array $changes): string”changeRoleAbilities(int $actorId, string $roleKey, array $changes, Confirmation $confirmation, DateTimeImmutable $now): OperationResult
Section titled “changeRoleAbilities(int $actorId, string $roleKey, array $changes, Confirmation $confirmation, DateTimeImmutable $now): OperationResult”requestAccess(int $requesterId, ?string $abilityKey, ?string $areaKey, string $reason, DateTimeImmutable $now, DateTimeImmutable $expiresAt): OperationResult
Section titled “requestAccess(int $requesterId, ?string $abilityKey, ?string $areaKey, string $reason, DateTimeImmutable $now, DateTimeImmutable $expiresAt): OperationResult”Files a request, unless this person is already waiting on one for the same ability or area. The second ask is refused here and not by a caller, so the REST route, the form in the admin and anything written later give one answer: nothing is stored, nothing is audited as created and nobody is notified again. A request for something else, from somebody else, or made after the earlier one was decided or ran out, is a new request.
previewApproval(int $actorId, int $requestId): ?AccessApprovalPreview
Section titled “previewApproval(int $actorId, int $requestId): ?AccessApprovalPreview”What approving this request would grant, for the approver to read before confirming (spec 112, FR-002, FR-003). Null when the request is no longer pending.
approveRequest(int $actorId, int $requestId, string $note, int $expiryDays, Confirmation $confirmation, DateTimeImmutable $now): OperationResult
Section titled “approveRequest(int $actorId, int $requestId, string $note, int $expiryDays, Confirmation $confirmation, DateTimeImmutable $now): OperationResult”Grants what a pending request asks for, until the chosen expiry (spec 112, FR-002, FR-003). Refused, and nothing granted, without a note, with an expiry it does not offer, with a confirmation for anything else (or without the dangerous ability’s name typed), or when the access policy refuses what a role change would refuse. A request for an ability a request may no longer ask for is cancelled instead (FR-008).
denyRequest(int $actorId, int $requestId, string $note, DateTimeImmutable $now): OperationResult
Section titled “denyRequest(int $actorId, int $requestId, string $note, DateTimeImmutable $now): OperationResult”approvalHash(int $requestId, array $abilityKeys): string
Section titled “approvalHash(int $requestId, array $abilityKeys): string”What a confirmation for approving this request is bound to: the request and what it grants.
requestedAbilities(array $request): array
Section titled “requestedAbilities(array $request): array”What a request grants: its ability, or every ability of its area.