#85403Copy of recursive pagetree does not keep permissions of the copy-source
Description
Problem/Description
initial situation
- Pagetree with configured page permissions for each/every subpage.
- backend user config allows recursive copying
Problem
- The copied pagetree doesn’t keep any of the permissions (An editor have to configure each copied pagetree and can not really benefit (except the copied pagetree))
perms_userid,perms_groupid,perms_user,perms_group,perms_everybody
Test #1
I removed any PageTSConfig: all subpages getting the same permissions as the rootpage which get’s copied.
Test #2
The root page includes following PageTSConfig:
TCEMAIN {
// Permissions for "user"
permissions.user = show,edit,delete,new,editcontent
// Permissions for "group"
permissions.group = show,edit,delete,new,editcontent
// Set owner group
permissions.groupid = 1
// Permissions for "everybody"
permissions.everybody =
}
—-
All subpages get these permissions. I would assume that when copying a record only the UID and the PIP columns gets adjusted by the datahandler.
Acceptance Criteria
- All page permissions must be kept no matter if only one page or recursive pages are copied in the TYPO3 backend
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch
- Commit message
-
[BUGFIX] Copy of recursive pagetree does not keep permissions of the copy-source Resolves: #85403 Releases: main
Related issues 1
History 10
-
Josef Glatz changed category
parent task #69617<span data-processor="relativetime" data-value="2018-06-27T08:51:57+00:00" > 06/27/18, 08:51 </span> -
Josef Glatz changed description <span data-processor="relativetime" data-value="2018-06-27T09:01:22+00:00" > 06/27/18, 09:01 </span>
-
Josef Glatz changed description TYPO3 Version
89 <span data-processor="relativetime" data-value="2018-12-13T00:59:55+00:00" > 12/13/18, 00:59 </span> -
Josef Glatz changed assigned to Josef Glatz <span data-processor="relativetime" data-value="2018-12-13T01:00:02+00:00" > 12/13/18, 01:00 </span>
-
Anonymous commented <span data-processor="relativetime" data-value="2019-03-27T08:13:52+00:00" > 03/27/19, 08:13 </span>
Well maybe I don’t use the permission stuff in DataHandler the right way?
Setting
$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPermissions'] = [ 'user' => 'show,edit,delete,new,editcontent', 'group' => 'show,edit,new,editcontent', 'everybody' => 'show,edit,delete,new,editcontent' ];in my AdditionalConfiguration.php and using the code above the permissions are set like defined in $GLOBALS[‘TYPO3_CONF_VARS’][‘BE’][‘defaultPermissions’].
But this does not solve the main problem that copied pages don’t inherit the permissions from there source page.
-
Josef Glatz changed removed the assignee <span data-processor="relativetime" data-value="2020-03-04T08:27:24+00:00" > 03/04/20, 08:27 </span>
-
Christian Eßl changed category <span data-processor="relativetime" data-value="2020-03-11T21:25:55+00:00" > 03/11/20, 21:25 </span>
-
Benni Mack commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2026-10-18T16:32:45+00:00" > 10/18/26, 16:32 </span>Hi everyone,
I checked this on current main, and the behaviour is still the same. As far as I can tell, that’s intended.
A copied page is a new page. The perms_* fields are deliberately not copied: the copy gets the permissions from TCEMAIN.permissions.* of the target page (or $GLOBALS[‘TYPO3_CONF_VARS’][‘BE’][‘defaultPermissions’]), and the user who copies it becomes the owner. If we copied the source’s permissions, the copy would still belong to the original owner. Editors could then end up with pages they can’t edit or delete themselves.
For the edge case where a project really needs the permissions copied, there’s now the BeforeRemoveNonCopyableFieldsEvent (#106456). A listener can take the perms_* fields off the list, and they are copied along with the page:
#[AsEventListener] public function __invoke(BeforeRemoveNonCopyableFieldsEvent $event): void { if ($event->getTable() !== 'pages' || $event->getCallingOperation() !== 'copyRecord') { return; } $event->setNonCopyableFields(array_diff( $event->getNonCopyableFields(), ['perms_groupid', 'perms_user', 'perms_group', 'perms_everybody'] )); }This keeps the group and permission bits but still makes the copying user the owner.
What do you think? Since this is an edge case that can now be solved with the event, I’d suggest we keep the current behaviour in Core as intended and close this issue. Any objections?
-
Georg Ringer changed Related to #68202 <span data-processor="relativetime" data-value="2026-10-21T18:50:31+00:00" > 10/21/26, 18:50 </span>
Can confirm this bug. TYPO3 9.5.5
Even using the TYPO3\CMS\Core\DataHandling\DataHandler to copy a tree ignores the permission.
This copies the tree but the permissions and the group is not set even I override the $dataHandler->defaultPermissions and $dataHandler->defaultValues.