]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controller.php
Notifications: Switched testing from string to reference levels
[bookstack] / app / Http / Controller.php
index 78b899d25559fd63370fc62342b54e95d9ab6330..584cea3aa74cd8ccffa7d5e366376b19ff8718dd 100644 (file)
@@ -66,6 +66,16 @@ abstract class Controller extends BaseController
         }
     }
 
+    /**
+     * Prevent access for guest users beyond this point.
+     */
+    protected function preventGuestAccess(): void
+    {
+        if (!signedInUser()) {
+            $this->showPermissionError();
+        }
+    }
+
     /**
      * Check the current user's permissions against an ownable item otherwise throw an exception.
      */