GenericAclService
extends AbstractAclService
in package
AbstractYes
Table of Contents
Properties
- $apiUserAuthService : ApiAuthenticationService
- $checkedIps : array<string, bool>
- $companyUserAuthService : AuthenticationService
- $remoteAddress : string
- $translator : Translator
- $tueRanges : array<string|int, mixed>
- $userAuthService : AuthenticationService
Methods
- __construct() : mixed
- getCompanyUserIdentity() : CompanyUser|null
- Get the company user identity or `null` if no `CompanyUser` is logged in.
- getCompanyUserIdentityOrThrowException() : CompanyUser
- Gets the company user identity or gives a 403 if the company user is not logged in.
- getIdentity() : IdentityInterface|null
- Gets the user identity if logged in or null otherwise
- getUserIdentity() : User|null
- Get the user identity or `null` if no `User` is logged in.
- getUserIdentityOrThrowException() : User
- Gets the user identity or gives a 403 if the user is not logged in.
- hasIdentity() : bool
- Checks whether the user is logged in
- isAllowed() : bool
- Check if a operation is allowed for the current role.
- getAcl() : Acl
- Get the ACL.
- getRole() : RoleInterface|string
- Get the current user's role.
- fromTueNetwork() : bool
- Check whether the remote address (as returned by the proxy) comes from a TU/e network. Networks are provided in CIDR notation.
Properties
$apiUserAuthService read-only
private
ApiAuthenticationService
$apiUserAuthService
$checkedIps
private
array<string, bool>
$checkedIps
= []
$companyUserAuthService read-only
private
AuthenticationService
$companyUserAuthService
$remoteAddress read-only
private
string
$remoteAddress
$translator read-only
private
Translator
$translator
$tueRanges read-only
private
array<string|int, mixed>
$tueRanges
$userAuthService read-only
private
AuthenticationService
$userAuthService
Methods
__construct()
public
__construct(Translator $translator, AuthenticationService $userAuthService, AuthenticationService $companyUserAuthService, ApiAuthenticationService $apiUserAuthService, array<string|int, string> $tueRanges, string $remoteAddress) : mixed
Parameters
- $translator : Translator
- $userAuthService : AuthenticationService
- $companyUserAuthService : AuthenticationService
- $apiUserAuthService : ApiAuthenticationService
- $tueRanges : array<string|int, string>
- $remoteAddress : string
Tags
getCompanyUserIdentity()
Get the company user identity or `null` if no `CompanyUser` is logged in.
public
getCompanyUserIdentity() : CompanyUser|null
Return values
CompanyUser|nullgetCompanyUserIdentityOrThrowException()
Gets the company user identity or gives a 403 if the company user is not logged in.
public
getCompanyUserIdentityOrThrowException() : CompanyUser
Tags
Return values
CompanyUsergetIdentity()
Gets the user identity if logged in or null otherwise
public
getIdentity() : IdentityInterface|null
Return values
IdentityInterface|null —the current logged in user
getUserIdentity()
Get the user identity or `null` if no `User` is logged in.
public
getUserIdentity() : User|null
Return values
User|nullgetUserIdentityOrThrowException()
Gets the user identity or gives a 403 if the user is not logged in.
public
getUserIdentityOrThrowException() : User
Tags
Return values
UserhasIdentity()
Checks whether the user is logged in
public
hasIdentity() : bool
Return values
bool —true if the user is logged in, false otherwise
isAllowed()
Check if a operation is allowed for the current role.
public
isAllowed(string $operation, string|ResourceInterface $resource) : bool
Parameters
- $operation : string
-
operation to be checked
- $resource : string|ResourceInterface
-
Resource to be checked
Return values
boolgetAcl()
Get the ACL.
protected
abstract getAcl() : Acl
Return values
AclgetRole()
Get the current user's role.
protected
getRole() : RoleInterface|string
Tags
Return values
RoleInterface|stringfromTueNetwork()
Check whether the remote address (as returned by the proxy) comes from a TU/e network. Networks are provided in CIDR notation.
private
fromTueNetwork() : bool