AccessRequestService
in package
Access Request Service.
Manages access requests from users.
Table of Contents
Methods
- approve() : bool
- Approve access request.
- create() : int
- Create access request.
- deny() : bool
- Deny access request.
- getById() : object|null
- Get request by ID.
- getPendingRequests() : array<string|int, mixed>
- Get pending requests for admin.
- getPurposes() : Collection
- Get purposes list.
- getStats() : array<string|int, mixed>
- Get request statistics.
- getUserRequests() : array<string|int, mixed>
- Get user's access requests.
- hasApprovedAccess() : bool
- Check if user has approved access.
- withdraw() : bool
- Withdraw access request.
Methods
approve()
Approve access request.
public
approve(int $id, int $decisionBy[, array<string|int, mixed> $options = [] ]) : bool
Parameters
- $id : int
- $decisionBy : int
- $options : array<string|int, mixed> = []
Return values
boolcreate()
Create access request.
public
create(array<string|int, mixed> $data) : int
Parameters
- $data : array<string|int, mixed>
Return values
intdeny()
Deny access request.
public
deny(int $id, int $decisionBy[, string|null $reason = null ]) : bool
Parameters
- $id : int
- $decisionBy : int
- $reason : string|null = null
Return values
boolgetById()
Get request by ID.
public
getById(int $id) : object|null
Parameters
- $id : int
Return values
object|nullgetPendingRequests()
Get pending requests for admin.
public
getPendingRequests([array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed> = []
Return values
array<string|int, mixed>getPurposes()
Get purposes list.
public
getPurposes([bool $enabledOnly = true ]) : Collection
Parameters
- $enabledOnly : bool = true
Return values
CollectiongetStats()
Get request statistics.
public
getStats() : array<string|int, mixed>
Return values
array<string|int, mixed>getUserRequests()
Get user's access requests.
public
getUserRequests(int $userId[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
Parameters
- $userId : int
- $params : array<string|int, mixed> = []
Return values
array<string|int, mixed>hasApprovedAccess()
Check if user has approved access.
public
hasApprovedAccess(int $userId, int $objectId) : bool
Parameters
- $userId : int
- $objectId : int
Return values
boolwithdraw()
Withdraw access request.
public
withdraw(int $id, int $userId) : bool
Parameters
- $id : int
- $userId : int