mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-05 01:24:38 +08:00
Initial updates to allow for page copy when the user can read the page but can't update it.
This commit is contained in:
@ -641,7 +641,7 @@ class PageController extends Controller
|
|||||||
public function showCopy($bookSlug, $pageSlug)
|
public function showCopy($bookSlug, $pageSlug)
|
||||||
{
|
{
|
||||||
$page = $this->pageRepo->getPageBySlug($pageSlug, $bookSlug);
|
$page = $this->pageRepo->getPageBySlug($pageSlug, $bookSlug);
|
||||||
$this->checkOwnablePermission('page-update', $page);
|
$this->checkOwnablePermission('page-view', $page);
|
||||||
session()->flashInput(['name' => $page->name]);
|
session()->flashInput(['name' => $page->name]);
|
||||||
return view('pages/copy', [
|
return view('pages/copy', [
|
||||||
'book' => $page->book,
|
'book' => $page->book,
|
||||||
@ -660,7 +660,7 @@ class PageController extends Controller
|
|||||||
public function copy($bookSlug, $pageSlug, Request $request)
|
public function copy($bookSlug, $pageSlug, Request $request)
|
||||||
{
|
{
|
||||||
$page = $this->pageRepo->getPageBySlug($pageSlug, $bookSlug);
|
$page = $this->pageRepo->getPageBySlug($pageSlug, $bookSlug);
|
||||||
$this->checkOwnablePermission('page-update', $page);
|
$this->checkOwnablePermission('page-view', $page);
|
||||||
|
|
||||||
$entitySelection = $request->get('entity_selection', null);
|
$entitySelection = $request->get('entity_selection', null);
|
||||||
if ($entitySelection === null || $entitySelection === '') {
|
if ($entitySelection === null || $entitySelection === '') {
|
||||||
|
@ -17,12 +17,14 @@
|
|||||||
@if(userCan('page-update', $page))
|
@if(userCan('page-update', $page))
|
||||||
<a href="{{ $page->getUrl('/edit') }}" class="text-primary text-button" >@icon('edit'){{ trans('common.edit') }}</a>
|
<a href="{{ $page->getUrl('/edit') }}" class="text-primary text-button" >@icon('edit'){{ trans('common.edit') }}</a>
|
||||||
@endif
|
@endif
|
||||||
@if(userCan('page-update', $page) || userCan('restrictions-manage', $page) || userCan('page-delete', $page))
|
@if(userCan('page-create-own') || userCan('page-create-all') || userCan('page-update', $page) || userCan('restrictions-manage', $page) || userCan('page-delete', $page))
|
||||||
<div dropdown class="dropdown-container">
|
<div dropdown class="dropdown-container">
|
||||||
<a dropdown-toggle class="text-primary text-button">@icon('more') {{ trans('common.more') }}</a>
|
<a dropdown-toggle class="text-primary text-button">@icon('more') {{ trans('common.more') }}</a>
|
||||||
<ul>
|
<ul>
|
||||||
@if(userCan('page-update', $page))
|
@if(userCan('page-create-own') || userCan('page-create-all'))
|
||||||
<li><a href="{{ $page->getUrl('/copy') }}" class="text-primary" >@icon('copy'){{ trans('common.copy') }}</a></li>
|
<li><a href="{{ $page->getUrl('/copy') }}" class="text-primary" >@icon('copy'){{ trans('common.copy') }}</a></li>
|
||||||
|
@endif
|
||||||
|
@if(userCan('page-update', $page))
|
||||||
<li><a href="{{ $page->getUrl('/move') }}" class="text-primary" >@icon('folder'){{ trans('common.move') }}</a></li>
|
<li><a href="{{ $page->getUrl('/move') }}" class="text-primary" >@icon('folder'){{ trans('common.move') }}</a></li>
|
||||||
<li><a href="{{ $page->getUrl('/revisions') }}" class="text-primary">@icon('history'){{ trans('entities.revisions') }}</a></li>
|
<li><a href="{{ $page->getUrl('/revisions') }}" class="text-primary">@icon('history'){{ trans('entities.revisions') }}</a></li>
|
||||||
@endif
|
@endif
|
||||||
|
Reference in New Issue
Block a user