AclService
extends AclService
in package
Table of Contents
Properties
- $acl : Acl
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.
- createAcl() : void
- getAcl() : Acl
- Get the ACL.
- getRole() : RoleInterface|string
- Get the current user's role.
Properties
$acl
protected
Acl
$acl
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
boolcreateAcl()
protected
createAcl() : void
getAcl()
Get the ACL.
protected
getAcl() : Acl
Return values
AclgetRole()
Get the current user's role.
protected
getRole() : RoleInterface|string