X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/615741af9d36c725299cc8fc9c0ee012bd3d5759..refs/pull/5312/head:/app/Activity/Notifications/Handlers/BaseNotificationHandler.php diff --git a/app/Activity/Notifications/Handlers/BaseNotificationHandler.php b/app/Activity/Notifications/Handlers/BaseNotificationHandler.php index f1742592e..b5f339b2c 100644 --- a/app/Activity/Notifications/Handlers/BaseNotificationHandler.php +++ b/app/Activity/Notifications/Handlers/BaseNotificationHandler.php @@ -10,11 +10,6 @@ use BookStack\Users\Models\User; abstract class BaseNotificationHandler implements NotificationHandler { - public function __construct( - protected PermissionApplicator $permissionApplicator - ) { - } - /** * @param class-string $notification * @param int[] $userIds @@ -35,7 +30,8 @@ abstract class BaseNotificationHandler implements NotificationHandler } // Prevent sending if the user does not have access to the related content - if (!$this->permissionApplicator->checkOwnableUserAccess($relatedModel, 'view')) { + $permissions = new PermissionApplicator($user); + if (!$permissions->checkOwnableUserAccess($relatedModel, 'view')) { continue; }