Fix support API audit logging
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-28 21:02:25 +01:00
parent f0e8cee850
commit 0d2759b0d4
6 changed files with 308 additions and 143 deletions

View File

@@ -88,6 +88,23 @@ class SupportApiRegistry
return (bool) ($config['read_only'] ?? false);
}
public static function auditAction(string $resource, string $operation): string
{
$config = self::get($resource);
$action = null;
if ($config && is_array($config['audit'] ?? null)) {
$action = $config['audit'][$operation] ?? null;
}
if (is_string($action) && $action !== '') {
return $action;
}
return $resource.'.'.$operation;
}
public static function allowsMutation(string $resource, string $action): bool
{
if (self::isReadOnly($resource)) {