CoolCMS API

ApiClientContext
in package

FinalYes

External Api client whose key came with the request being processed right now.

Set in one place only: ApiClientKeyTrait::checkClientKey() in startup() of the Api presenter, so only on the external HTTP path. Web and admin call the Api through ApiBridge without startup(), so nothing is ever set there and the role ceiling does not apply to them.

Read by PermissionResolver: the client's allowed roles cap the caller's roles in every decision of the request, including a nested internal call the Api presenter makes during the external request (it is still the same caller).

Table of Contents

Properties

$client  : ApiClientIdentity|null

Methods

get()  : ApiClientIdentity|null
getAllowedRoleCodes()  : array<int, string>|null
Returns the role codes that may be applied; `null` means no restriction (web, admin, cron, an external call without a key while `api.clientKey.required` is false).
set()  : void

Properties

Methods

getAllowedRoleCodes()

Returns the role codes that may be applied; `null` means no restriction (web, admin, cron, an external call without a key while `api.clientKey.required` is false).

public getAllowedRoleCodes() : array<int, string>|null
Return values
array<int, string>|null
On this page

Search results