X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/f634b4ea5767e6d823088c512872f9114322f7d0..refs/pull/4252/head:/app/Http/Controllers/ChapterController.php diff --git a/app/Http/Controllers/ChapterController.php b/app/Http/Controllers/ChapterController.php index 735c760be..4d2bcb2f1 100644 --- a/app/Http/Controllers/ChapterController.php +++ b/app/Http/Controllers/ChapterController.php @@ -9,7 +9,6 @@ use BookStack\Entities\Tools\BookContents; use BookStack\Entities\Tools\Cloner; use BookStack\Entities\Tools\HierarchyTransformer; use BookStack\Entities\Tools\NextPreviousContentLocator; -use BookStack\Entities\Tools\PermissionsUpdater; use BookStack\Exceptions\MoveOperationException; use BookStack\Exceptions\NotFoundException; use BookStack\Exceptions\PermissionsException; @@ -23,7 +22,6 @@ class ChapterController extends Controller protected ChapterRepo $chapterRepo; protected ReferenceFetcher $referenceFetcher; - public function __construct(ChapterRepo $chapterRepo, ReferenceFetcher $referenceFetcher) { $this->chapterRepo = $chapterRepo; @@ -244,38 +242,6 @@ class ChapterController extends Controller return redirect($chapterCopy->getUrl()); } - /** - * Show the Restrictions view. - * - * @throws NotFoundException - */ - public function showPermissions(string $bookSlug, string $chapterSlug) - { - $chapter = $this->chapterRepo->getBySlug($bookSlug, $chapterSlug); - $this->checkOwnablePermission('restrictions-manage', $chapter); - - return view('chapters.permissions', [ - 'chapter' => $chapter, - ]); - } - - /** - * Set the restrictions for this chapter. - * - * @throws NotFoundException - */ - public function permissions(Request $request, PermissionsUpdater $permissionsUpdater, string $bookSlug, string $chapterSlug) - { - $chapter = $this->chapterRepo->getBySlug($bookSlug, $chapterSlug); - $this->checkOwnablePermission('restrictions-manage', $chapter); - - $permissionsUpdater->updateFromPermissionsForm($chapter, $request); - - $this->showSuccessNotification(trans('entities.chapters_permissions_success')); - - return redirect($chapter->getUrl()); - } - /** * Convert the chapter to a book. */