d919b70a2e
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
27 lines
732 B
PHP
27 lines
732 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace KTXC\Service;
|
|
|
|
use KTXC\Context\IdentityContextInterface;
|
|
|
|
final class SystemFirewallLogService
|
|
{
|
|
public const PERMISSION_READ = 'firewall.system.logs.read';
|
|
|
|
public function __construct(
|
|
private readonly FirewallLogService $logs,
|
|
private readonly IdentityContextInterface $identity,
|
|
) {
|
|
}
|
|
|
|
public function query(?string $tenantId, array $filters, int $limit = 50, int $offset = 0): array
|
|
{
|
|
if (!$this->identity->hasPermission(self::PERMISSION_READ)) {
|
|
throw new \RuntimeException('Missing required permission: '.self::PERMISSION_READ);
|
|
}
|
|
return $this->logs->system($tenantId, $filters, $limit, $offset);
|
|
}
|
|
}
|