mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX #4423: Don't allow page duplication if canCreate is false.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@85157 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
7eef2f4b25
commit
6a209ce8df
@ -1159,7 +1159,9 @@ JS;
|
||||
function duplicate() {
|
||||
if(($id = $this->urlParams['ID']) && is_numeric($id)) {
|
||||
$page = DataObject::get_by_id("SiteTree", $id);
|
||||
if($page && !$page->canEdit()) return Security::permissionFailure($this);
|
||||
if($page && (!$page->canEdit() || !$page->canCreate())) {
|
||||
return Security::permissionFailure($this);
|
||||
}
|
||||
|
||||
$newPage = $page->duplicate();
|
||||
|
||||
@ -1178,7 +1180,9 @@ JS;
|
||||
function duplicatewithchildren() {
|
||||
if(($id = $this->urlParams['ID']) && is_numeric($id)) {
|
||||
$page = DataObject::get_by_id("SiteTree", $id);
|
||||
if($page && !$page->canEdit()) return Security::permissionFailure($this);
|
||||
if($page && (!$page->canEdit() || !$page->canCreate())) {
|
||||
return Security::permissionFailure($this);
|
||||
}
|
||||
|
||||
$newPage = $page->duplicateWithChildren();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user