[BUGFIX] Remove editing restriction for elements in workspace-stages
authorTolleiv Nietsch <info@tolleiv.de>
Wed, 22 Jun 2011 12:38:29 +0000 (14:38 +0200)
committerAndreas Wolf <andreas.wolf@ikt-werk.de>
Fri, 8 Jul 2011 21:22:36 +0000 (23:22 +0200)
Fix bug where a (workspace) element which left the "editing" state can't be edited anymore if the editor doesn't have appropriate permission
for the current stage of the element. Now everyone can edit if they
are member within the workspace.

Change-Id: I32a93ebc182514df7fe594ff9d7983fb6cc58e0e
Resolves: #27643
Releases: 4.6, 4.5
Reviewed-on: http://review.typo3.org/2874
Reviewed-by: Michael Klapper
Tested-by: Michael Klapper
Reviewed-by: Stefan Neufeind
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf
t3lib/class.t3lib_tcemain.php
t3lib/class.t3lib_userauthgroup.php

index 499154e..cf48040 100644 (file)
@@ -858,6 +858,7 @@ class t3lib_TCEmain {
                                                                        $newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['tstamp']] = $GLOBALS['EXEC_TIME'];
                                                                }
                                                        }
+                                                               // Set stage to "Editing" to make sure we restart the workflow
                                                        if ($TCA[$table]['ctrl']['versioningWS']) {
                                                                $fieldArray['t3ver_stage'] = 0;
                                                        }
index e620243..294b990 100644 (file)
@@ -751,8 +751,9 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
                                                return 'Versioning disabled for table';
                                        } elseif ((int) $recData['t3ver_wsid'] !== $this->workspace) { // So does workspace match?
                                                return 'Workspace ID of record didn\'t match current workspace';
-                                       } else { // So what about the stage of the version, does that allow editing for this user?
-                                               return $this->workspaceCheckStageForCurrent($recData['t3ver_stage']) ? FALSE : 'Record stage "' . $recData['t3ver_stage'] . '" and users access level did not allow for editing';
+                                       } else {
+                                                       // So is the user allowed to "use" the edit stage within the workspace?
+                                               return $this->workspaceCheckStageForCurrent(0) ? FALSE : 'User\'s access level did not allow for editing';
                                        }
                                } else { // We are testing a "live" record:
                                        if ($res = $this->workspaceAllowLiveRecordsInPID($recData['pid'], $table)) { // For "Live" records, check that PID for table allows editing
@@ -1922,4 +1923,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_userauthgroup.php']);
 }
 
-?>
\ No newline at end of file
+?>