1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Notifications: Fixed send content permission checking

Added test and changed logic to properly check the view permissions for
the notification receiver before sending.
Required change to permissions applicator to allow the user to be
manually determined, and a service provider update to provide the class
as a singleton without a specific user, so it checks the current logged
in user on demand.
This commit is contained in:
Dan Brown
2023-08-17 17:57:31 +01:00
parent ee9e342b58
commit 38829f8a38
5 changed files with 31 additions and 9 deletions

View File

@ -24,7 +24,7 @@ class NotificationManager
$handlersToRun = $this->handlers[$activityType] ?? [];
foreach ($handlersToRun as $handlerClass) {
/** @var NotificationHandler $handler */
$handler = app()->make($handlerClass);
$handler = new $handlerClass();
$handler->handle($activity, $detail, $user);
}
}