'notifications' =>
$notifications,
'timestamp' =>
$latestTimestamp,
];
} private function formatNotifications(NotificationCollection
$notifications, AdminApiSource
$source): NotificationCollection
{ $responseNotifications =
new NotificationCollection();
/** @var NotificationEntity $notification */
foreach ($notifications as $notification) { if ($this->
isAllow($notification->
getRequiredPrivileges(),
$source)) { $responseNotifications->
add($notification);
} } return $responseNotifications;
} private function isAllow(array
$privileges, AdminApiSource
$source): bool
{ foreach ($privileges as $privilege) { if (!
$source->
isAllowed($privilege)) {