Bug #16236
closedpermissions of versioned pages are not changed in draft workspace
0%
Description
When you change the access permissions of a page in a draft-workspace and apply the changes recursively, the changes are not applied to subpages which already have a new version in this workspace. The permissions are not changed with the original versions either.
I located a bug in typo3/mod/web/perm/index.php (class SC_mod_web_perm_index), function getRecursiveSelect. This function creates the select-box for choosing if and how many levels the permissions should be set recursively.
The problem is that this function always uses the id of the live-record as supplied by t3lib_treeview::getTree. This function returns an array of pages, each with some fields from the page-record. One of the supplied fields is _ORIG_uid, which is the id of the workspace-record with versionized pages.
To fix the bug, I extended the function t3lib_treeview::getTree to add a attribute orig_ids_hierarchy to the current instance of the object. Normally ids_hierarchy is used, but this contains only the uids of the life-records.
The new attribute is used instead of ids_hierarchy in SC_mod_web_perm_index::getRecursiveSelect, so this function now respects the versionized pages when creating the select-box.
(issue imported from #M3666)
Files
Updated by Andreas Wolf over 18 years ago
I have just refined the patchfile a bit to make patching easier. Please use 3666_new.patch instead of 3666.patch. (Could one of the admins please delete the old file?)
Updated by Andreas Wolf about 18 years ago
Another thing about the patch: The line
if ($GLOBALS['BE_USER']->user['uid'] && count($tree->ids_hierarchy)) {
in typo3/mod/web/perm/index.php
should be also changed to
if ($GLOBALS['BE_USER']->user['uid'] && count($tree->orig_ids_hierarchy)) {
Updated by Andreas Wolf almost 18 years ago
Is there any chance to get this fixed in 4.1?
Updated by Martin Kutschker over 17 years ago
With this patch only the pages with versions in the current workspace are affect (but no pages in the LIVE workspace).
Was this intended?
Updated by Andreas Wolf over 17 years ago
Yes, that's a problem I couldn't solve. Normally I would say to only respect and change the permissions of the live-version, but that would require (massive) changes in the core. Additionally, this would have to be tested thoroughly.
Updated by Martin Kutschker over 17 years ago
But this behaviour is odd as well. I tried to change permissions on a folder with 5 subpages where only one page had a draft version. I expected 6 pages with changed permissions in my WS, but in fact only one was changed, which is odd.
Maybe it makes sense to honour the "allow live changes" flag of the WS. If not set, the patch behaviour is right (change only drafts in a WS). But if set, the permissions should be changed for all pages (live and WS).
Anyway, while I'm not sure if this is the best solutions of all, it's an improvement.
Updated by Michael Stucki almost 11 years ago
- Category changed from Miscellaneous to Workspaces
Updated by Michael Stucki almost 11 years ago
- Project changed from 624 to TYPO3 Core
- Category changed from Workspaces to Workspaces
- Target version deleted (
0)