AuthorizationManagerInterface
in
Contract for managing member activity authorizations.
Defines the service layer for authorization workflows including requests, activation, revocations, and retractions. Approval and denial are now handled entirely by the unified workflow engine. All methods return ServiceResult objects and require external transaction management.
Tags
Table of Contents
Methods
- activate() : ServiceResult
- Activate a fully-approved authorization.
- request() : ServiceResult
- Initiate a new authorization request.
- retract() : ServiceResult
- Retract (cancel) a pending authorization request.
- revoke() : ServiceResult
- Revoke an active authorization.
Methods
activate()
Activate a fully-approved authorization.
public
activate(int $authorizationId, int $approverId) : ServiceResult
Sets status to APPROVED, starts ActiveWindow for temporal validation, and assigns the activity's granted role. Does not send notifications.
Parameters
- $authorizationId : int
-
ID of authorization to activate
- $approverId : int
-
ID of the final approver triggering activation
Return values
ServiceResult —Success with activation data or error details
request()
Initiate a new authorization request.
public
request(int $requesterId, int $activityId, int $approverId, bool $isRenewal) : ServiceResult
Validates member eligibility, assigns approver, creates authorization in pending status. Requires external transaction.
Parameters
- $requesterId : int
-
ID of member requesting authorization
- $activityId : int
-
ID of activity for authorization
- $approverId : int
-
ID of assigned approver
- $isRenewal : bool
-
Whether this is a renewal request
Return values
ServiceResult —Success with the inserted authorizationId, or error details
retract()
Retract (cancel) a pending authorization request.
public
retract(int $authorizationId, int $requesterId) : ServiceResult
Allows requester to cancel their own pending request before approval/denial. Requires external transaction.
Parameters
- $authorizationId : int
-
ID of authorization to retract
- $requesterId : int
-
ID of member retracting (must be owner)
Return values
ServiceResult —Success with retraction confirmation or error details
revoke()
Revoke an active authorization.
public
revoke(int $authorizationId, int $revokerId, string $revokedReason) : ServiceResult
Administratively revokes authorization with reasoning. Handles role removal and cascade effects. Requires external transaction.
Parameters
- $authorizationId : int
-
ID of authorization to revoke
- $revokerId : int
-
ID of administrator performing revocation
- $revokedReason : string
-
Detailed reason for revocation
Return values
ServiceResult —Success with revocation confirmation or error details