Skip to content

Commit

Permalink
Audit the tag creator
Browse files Browse the repository at this point in the history
Signed-off-by: greta <gretadoci@gmail.com>
  • Loading branch information
GretaD committed Aug 30, 2023
1 parent da3c941 commit 95a1f06
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apps/admin_audit/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ private function registerHooks(IAuditLogger $logger,
$this->versionsHooks($logger);

$this->securityHooks($logger, $eventDispatcher);
$this->tagHooks($logger, $eventDispatcher);
}

private function userManagementHooks(IAuditLogger $logger,
Expand Down Expand Up @@ -189,6 +190,13 @@ private function consoleHooks(IAuditLogger $logger,
$appActions->runCommand($event->getArguments());
});
}
private function tagHooks(IAuditLogger $logger,
IEventDispatcher $eventDispatcher): void {
$eventDispatcher->addListener(\OCP\SystemTag\ManagerEvent::EVENT_CREATE, function (\OCP\SystemTag\ManagerEvent $event) use ($logger) {

Check notice

Code scanning / Psalm

DeprecatedConstant Note

Constant OCP\SystemTag\ManagerEvent::EVENT_CREATE is deprecated
$appActions = new Console($logger);
$appActions->runCommand([$event->getTag()->getName()]);
});
}

private function fileHooks(IAuditLogger $logger,
IEventDispatcher $eventDispatcher): void {
Expand Down

0 comments on commit 95a1f06

Please sign in to comment.