Documentation

AclService extends AclService
in package

Table of Contents

Properties

$acl  : Acl
$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.
createAcl()  : void
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

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
psalm-param

UserAuthenticationService<UserSession, UserAdapter> $userAuthService

psalm-param

CompanyUserAuthenticationService<CompanyUserSession, CompanyUserAdapter> $companyUserAuthService

getUserIdentity()

Get the user identity or `null` if no `User` is logged in.

public getUserIdentity() : User|null
Return values
User|null

hasIdentity()

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
bool

getAcl()

Get the ACL.

protected getAcl() : Acl
Return values
Acl

getRole()

Get the current user's role.

protected getRole() : RoleInterface|string
Tags
inheritDoc

The role that should take precedence should be returned first. This is because of the behaviour of .

Return values
RoleInterface|string

fromTueNetwork()

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
Return values
bool

        
On this page

Search results