$hook->
getContext()->
getTaxState(),
$hook->
getContext()->
getRounding() );
} private function getAppContextSource(ScriptAppInformation
$scriptAppInformation): AdminApiSource
{ if (\
array_key_exists($scriptAppInformation->
getAppId(),
$this->appSources
)) { return $this->appSources
[$scriptAppInformation->
getAppId()];
} $privileges =
$this->
fetchPrivileges($scriptAppInformation->
getAppId());
$source =
new AdminApiSource(null,
$scriptAppInformation->
getIntegrationId());
$source->
setIsAdmin(false
);
$source->
setPermissions($privileges);
return $this->appSources
[$scriptAppInformation->
getAppId()] =
$source;
} private function fetchPrivileges(string
$appId): array
{ $privileges =
$this->connection->
fetchOne('
SELECT `acl_role`.`privileges` AS `privileges`
FROM `acl_role`
INNER JOIN `app` ON `app`.`acl_role_id` = `acl_role`.`id`
WHERE `app`.`id` = :appId
',