]> BookStack Code Mirror - bookstack/blobdiff - app/Activity/Controllers/WatchController.php
Permissions: Updated usage of controller methods to use enum
[bookstack] / app / Activity / Controllers / WatchController.php
index c0b1c58724926752c8656fc3685431f0e6361a9f..b77a893ea58b8c5d81a5a5004ec3e654ab3423f6 100644 (file)
@@ -5,13 +5,14 @@ namespace BookStack\Activity\Controllers;
 use BookStack\Activity\Tools\UserEntityWatchOptions;
 use BookStack\Entities\Tools\MixedEntityRequestHelper;
 use BookStack\Http\Controller;
+use BookStack\Permissions\Permission;
 use Illuminate\Http\Request;
 
 class WatchController extends Controller
 {
     public function update(Request $request, MixedEntityRequestHelper $entityHelper)
     {
-        $this->checkPermission('receive-notifications');
+        $this->checkPermission(Permission::ReceiveNotifications);
         $this->preventGuestAccess();
 
         $requestData = $this->validate($request, array_merge([
@@ -24,6 +25,6 @@ class WatchController extends Controller
 
         $this->showSuccessNotification(trans('activities.watch_update_level_notification'));
 
-        return redirect()->back();
+        return redirect($watchable->getUrl());
     }
 }