- /**
- * Show the Permissions view.
- * @throws NotFoundException
- */
- public function showPermissions(string $bookSlug, string $pageSlug)
- {
- $page = $this->pageRepo->getBySlug($bookSlug, $pageSlug);
- $this->checkOwnablePermission('restrictions-manage', $page);
- return view('pages.permissions', [
- 'page' => $page,
- ]);
- }
-
- /**
- * Set the permissions for this page.
- * @throws NotFoundException
- * @throws Throwable
- */
- public function permissions(Request $request, string $bookSlug, string $pageSlug)
- {
- $page = $this->pageRepo->getBySlug($bookSlug, $pageSlug);
- $this->checkOwnablePermission('restrictions-manage', $page);
-
- $restricted = $request->get('restricted') === 'true';
- $permissions = $request->filled('restrictions') ? collect($request->get('restrictions')) : null;
- $this->pageRepo->updatePermissions($page, $restricted, $permissions);
+ $newName = $request->get('name') ?: $page->name;
+ $pageCopy = $cloner->clonePage($page, $newParent, $newName);
+ $this->showSuccessNotification(trans('entities.pages_copy_success'));