]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/ChapterController.php
Fix Crowdin name in the language_request issue template
[bookstack] / app / Http / Controllers / ChapterController.php
index 5cd720f02b97ac360ad0fc65e4e61dcd38500c6a..83b9bb692da6c3173305c538ab79a6a8a836da86 100644 (file)
@@ -11,6 +11,7 @@ use BookStack\Entities\Tools\NextPreviousContentLocator;
 use BookStack\Entities\Tools\PermissionsUpdater;
 use BookStack\Exceptions\MoveOperationException;
 use BookStack\Exceptions\NotFoundException;
+use BookStack\Exceptions\PermissionsException;
 use Illuminate\Http\Request;
 use Illuminate\Validation\ValidationException;
 use Throwable;
@@ -178,10 +179,10 @@ class ChapterController extends Controller
             return redirect($chapter->getUrl());
         }
 
-        // TODO - Check permissions against pages
-
         try {
             $newBook = $this->chapterRepo->move($chapter, $entitySelection);
+        } catch (PermissionsException $exception) {
+            $this->showPermissionError();
         } catch (MoveOperationException $exception) {
             $this->showErrorNotification(trans('errors.selected_book_not_found'));