Project

General

Profile

Actions

Bug #85403

open

Copy of recursive pagetree does not keep permissions of the copy-source

Added by Josef Glatz about 6 years ago. Updated over 4 years ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
Pagetree
Target version:
-
Start date:
2018-06-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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
Actions #1

Updated by Josef Glatz about 6 years ago

  • Category deleted (FormEngine aka TCEforms)
  • Parent task deleted (#69617)
Actions #2

Updated by Josef Glatz about 6 years ago

  • Description updated (diff)
Actions #3

Updated by Josef Glatz over 5 years ago

  • Description updated (diff)
  • TYPO3 Version changed from 8 to 9
Actions #4

Updated by Josef Glatz over 5 years ago

  • Assignee set to Josef Glatz
Actions #5

Updated by Anonymous over 5 years ago

Can confirm this bug. TYPO3 9.5.5

Even using the TYPO3\CMS\Core\DataHandling\DataHandler to copy a tree ignores the permission.

$cmd = array(
   'pages' => array(
      $srcPid => array(
         'copy' => array(
            'action' => 'paste',
            'target' => $targetPid,
            'update' => array(
               'title' => $newRootPageTitle,
               'hidden' => 0,
            )
         )
      )
    )
 );
 $dataHandler = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');
 $dataHandler->copyTree = 99;
 $dataHandler->defaultPermissions = [
    'user' => 'show,edit,delete,new,editcontent',
    'group' => 'show,edit,delete,new,editcontent',
    'everybody' => 'show,edit,delete,new,editcontent'
 ];
 $dataHandler->defaultValues = [
    'pages' => [
       'perms_groupid' => 1
    ]
 ];
 // define which tables should be copied
 $dataHandler->copyWhichTables = 'sys_template,tt_content,backend_layout';
 $dataHandler->start([], $cmd);
 $dataHandler->process_cmdmap();

This copies the tree but the permissions and the group is not set even I override the $dataHandler->defaultPermissions and $dataHandler->defaultValues.

Actions #6

Updated by Anonymous over 5 years ago

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.

Actions #7

Updated by Josef Glatz over 4 years ago

  • Assignee deleted (Josef Glatz)
Actions #8

Updated by Christian Eßl over 4 years ago

  • Category set to Pagetree
Actions

Also available in: Atom PDF