@@ 1498-1500 (lines=3) @@ | ||
1495 | if(($id = $this->urlParams['ID']) && is_numeric($id)) { |
|
1496 | /** @var SiteTree $page */ |
|
1497 | $page = SiteTree::get()->byID($id); |
|
1498 | if($page && (!$page->canEdit() || !$page->canCreate(null, array('Parent' => $page->Parent())))) { |
|
1499 | return Security::permissionFailure($this); |
|
1500 | } |
|
1501 | if(!$page || !$page->ID) throw new HTTPResponse_Exception("Bad record ID #$id", 404); |
|
1502 | ||
1503 | $newPage = $page->duplicate(); |
|
@@ 1537-1539 (lines=3) @@ | ||
1534 | if(($id = $this->urlParams['ID']) && is_numeric($id)) { |
|
1535 | /** @var SiteTree $page */ |
|
1536 | $page = SiteTree::get()->byID($id); |
|
1537 | if($page && (!$page->canEdit() || !$page->canCreate(null, array('Parent' => $page->Parent())))) { |
|
1538 | return Security::permissionFailure($this); |
|
1539 | } |
|
1540 | if(!$page || !$page->ID) throw new HTTPResponse_Exception("Bad record ID #$id", 404); |
|
1541 | ||
1542 | $newPage = $page->duplicateWithChildren(); |