]> BookStack Code Mirror - bookstack/blobdiff - app/Activity/Notifications/Handlers/BaseNotificationHandler.php
fix Sidebar scrolling at mid-range sceen
[bookstack] / app / Activity / Notifications / Handlers / BaseNotificationHandler.php
index f1742592e792d0808f1bc1f51c5c38a7d56fa703..b5f339b2ce0ba3f98f680df4339fc56910476d79 100644 (file)
@@ -10,11 +10,6 @@ use BookStack\Users\Models\User;
 
 abstract class BaseNotificationHandler implements NotificationHandler
 {
-    public function __construct(
-        protected PermissionApplicator $permissionApplicator
-    ) {
-    }
-
     /**
      * @param class-string<BaseActivityNotification> $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;
             }