AccessStorage implements LoggerAwareInterface uses LoggerAwareTrait
Wrapper for storing `AccessClaim` and `AccessGrant` items in the backend user session storage.
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Interfaces
- LoggerAwareInterface
Constants
Properties
- $currentTimestamp : int
- $factory : AccessFactory
Methods
- __construct() : mixed
- addClaim() : void
- addGrant() : void
- findClaimById() : AccessClaim|null
- findClaimBySubject() : AccessClaim|null
- findGrantsBySubject() : array<string|int, mixed>
- removeClaim() : void
- commitItems() : void
- fetchClaims() : array<string|int, mixed>
- fetchGrants() : array<string|int, mixed>
- fetchItems() : array<string|int, mixed>
- getBackendUser() : BackendUserAuthentication
- subjectMatchesItem() : bool
Constants
CLAIM_KEY
protected
mixed
CLAIM_KEY
= 'backend.sudo-mode.claim'
GRANT_KEY
protected
mixed
GRANT_KEY
= 'backend.sudo-mode.grant'
Properties
$currentTimestamp read-only
protected
int
$currentTimestamp
$factory read-only
protected
AccessFactory
$factory
Methods
__construct()
public
__construct(AccessFactory $factory) : mixed
Parameters
- $factory : AccessFactory
addClaim()
public
addClaim(AccessClaim $claim) : void
Parameters
- $claim : AccessClaim
addGrant()
public
addGrant(AccessGrant $grant) : void
Parameters
- $grant : AccessGrant
findClaimById()
public
findClaimById(string $id) : AccessClaim|null
Parameters
- $id : string
Return values
AccessClaim|nullfindClaimBySubject()
public
findClaimBySubject(AccessSubjectInterface $subject) : AccessClaim|null
Parameters
- $subject : AccessSubjectInterface
Return values
AccessClaim|nullfindGrantsBySubject()
public
findGrantsBySubject(AccessSubjectInterface $subject) : array<string|int, mixed>
Parameters
- $subject : AccessSubjectInterface
Return values
array<string|int, mixed>removeClaim()
public
removeClaim(AccessClaim $claim) : void
Parameters
- $claim : AccessClaim
commitItems()
protected
commitItems(string $sessionKey, array<string|int, mixed> $items) : void
Parameters
- $sessionKey : string
- $items : array<string|int, mixed>
fetchClaims()
protected
fetchClaims() : array<string|int, mixed>
Return values
array<string|int, mixed>fetchGrants()
protected
fetchGrants() : array<string|int, mixed>
Return values
array<string|int, mixed>fetchItems()
protected
fetchItems(string $sessionKey) : array<string|int, mixed>
Parameters
- $sessionKey : string
Return values
array<string|int, mixed>getBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationsubjectMatchesItem()
protected
subjectMatchesItem(AccessSubjectInterface $subject, array<string|int, mixed> $item) : bool
Parameters
- $subject : AccessSubjectInterface
- $item : array<string|int, mixed>