Skip to content
Snippets Groups Projects
Commit c8a0f8be authored by Frank Frewer's avatar Frank Frewer Committed by Jigal van Hemert
Browse files

[BUGFIX] Disable restricted users to handle page records in pagetree

This patch hides the context menu entries 'disable'/'enable', 'edit',
'new', 'cut', 'copy', 'paste into', 'paste after' and 'delete' in
case an user is restricted to only non default languages.
Additionally it throws an error message if the user is trying to edit
a page title directly in the pagetree via double click.

Resolves: #47126
Releases: 6.2,6.1, 6.0, 4.7, 4.5
Change-Id: I13537529d4b72763c3a2ff5c75b5ae53a9e3fec1
Reviewed-on: https://review.typo3.org/19802
Reviewed-by: Henrik Ziegenhain
Tested-by: Henrik Ziegenhain
Reviewed-by: Philipp Gampe
Reviewed-by: Alexander Opitz
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
parent 2030fdcf
Branches
Tags
No related merge requests found
......@@ -120,8 +120,12 @@ class Commands {
* @return void
*/
static public function updateNodeLabel(\TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode $node, $updatedLabel) {
$data['pages'][$node->getWorkspaceId()][$node->getTextSourceField()] = $updatedLabel;
self::processTceCmdAndDataMap(array(), $data);
if ($GLOBALS['BE_USER']->checkLanguageAccess(0)) {
$data['pages'][$node->getWorkspaceId()][$node->getTextSourceField()] = $updatedLabel;
self::processTceCmdAndDataMap(array(), $data);
} else {
throw new \RuntimeException(implode(chr(10), array('Editing title of page id \'' . $node->getWorkspaceId() . '\' failed. Editing default language is not allowed.')), 1365513336);
}
}
/**
......
......@@ -215,7 +215,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode {
* @return boolean
*/
public function canBeDisabledAndEnabled() {
return $this->canEdit($this->record);
return $this->canEdit($this->record) && $GLOBALS['BE_USER']->checkLanguageAccess(0);
}
/**
......@@ -224,7 +224,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode {
* @return boolean
*/
public function canBeCut() {
return $this->canEdit($this->record) && intval($this->record['t3ver_state']) !== 2;
return $this->canEdit($this->record) && intval($this->record['t3ver_state']) !== 2 && $GLOBALS['BE_USER']->checkLanguageAccess(0);
}
/**
......@@ -233,7 +233,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode {
* @return boolean
*/
public function canBeEdited() {
return $this->canEdit($this->record);
return $this->canEdit($this->record) && $GLOBALS['BE_USER']->checkLanguageAccess(0);
}
/**
......@@ -242,7 +242,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode {
* @return boolean
*/
public function canBeCopied() {
return $this->canCreate($this->record) && intval($this->record['t3ver_state']) !== 2;
return $this->canCreate($this->record) && intval($this->record['t3ver_state']) !== 2 && $GLOBALS['BE_USER']->checkLanguageAccess(0);
}
/**
......@@ -251,7 +251,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode {
* @return boolean
*/
public function canCreateNewPages() {
return $this->canCreate($this->record);
return $this->canCreate($this->record) && $GLOBALS['BE_USER']->checkLanguageAccess(0);
}
/**
......@@ -260,7 +260,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode {
* @return boolean
*/
public function canBeRemoved() {
return $this->canRemove($this->record) && intval($this->record['t3ver_state']) !== 2;
return $this->canRemove($this->record) && intval($this->record['t3ver_state']) !== 2 && $GLOBALS['BE_USER']->checkLanguageAccess(0);
}
/**
......@@ -269,7 +269,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode {
* @return boolean
*/
public function canBePastedInto() {
return $this->canCreate($this->record) && intval($this->record['t3ver_state']) !== 2;
return $this->canCreate($this->record) && intval($this->record['t3ver_state']) !== 2 && $GLOBALS['BE_USER']->checkLanguageAccess(0);
}
/**
......@@ -278,7 +278,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode {
* @return boolean
*/
public function canBePastedAfter() {
return $this->canCreate($this->record) && intval($this->record['t3ver_state']) !== 2;
return $this->canCreate($this->record) && intval($this->record['t3ver_state']) !== 2 && $GLOBALS['BE_USER']->checkLanguageAccess(0);
}
/**
......@@ -287,7 +287,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode {
* @return boolean
*/
public function canShowHistory() {
return TRUE;
return $GLOBALS['BE_USER']->checkLanguageAccess(0);
}
/**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment