[BUGFIX] Check if user is allowed to paste page to pagetree
authorMax Roesch <typo3@elbebass.com>
Sat, 14 Apr 2012 17:41:48 +0000 (19:41 +0200)
committerGeorg Ringer <mail@ringerge.org>
Mon, 7 May 2012 23:24:43 +0000 (01:24 +0200)
The user rights have checks for new / edit / delete, but paste was missing
leading to an error. Page actions 'paste into' and 'page after' now checks
if the user has rights for adding new pages to the current page.

Change-Id: Ief80a511d61ba386d667c62263d6f5335d1c87b8
Fixes: #33546
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/10483
Reviewed-by: Kilian Hann
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Reviewed-by: Felix Kopp
Tested-by: Felix Kopp
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
t3lib/tree/pagetree/class.t3lib_tree_pagetree_node.php

index 7f4d8ff..a4bc3cc 100644 (file)
@@ -276,7 +276,7 @@ class t3lib_tree_pagetree_Node extends t3lib_tree_extdirect_Node {
         * @return bool
         */
        public function canBePastedInto() {
-               return intval($this->record['t3ver_state']) !== 2;
+               return $this->canCreate($this->record) && intval($this->record['t3ver_state']) !== 2;
        }
 
        /**
@@ -285,7 +285,7 @@ class t3lib_tree_pagetree_Node extends t3lib_tree_extdirect_Node {
         * @return bool
         */
        public function canBePastedAfter() {
-               return intval($this->record['t3ver_state']) !== 2;
+               return $this->canCreate($this->record) && intval($this->record['t3ver_state']) !== 2;
        }
 
        /**
@@ -375,4 +375,4 @@ class t3lib_tree_pagetree_Node extends t3lib_tree_extdirect_Node {
        }
 }
 
-?>
\ No newline at end of file
+?>