Bug #18242 » workspaceAccessCheck.diff
typo3/classes/class.workspaceselector.php (working copy) | ||
---|---|---|
class WorkspaceSelector implements backend_toolbarItem {
|
||
private $changeWorkspace;
|
||
private $changeWorkspacePreview;
|
||
private $changeWorkspacePreview;
|
||
private $workspaceAccess;
|
||
/**
|
||
* reference back to the backend object
|
||
... | ... | |
public function __construct() {
|
||
$this->changeWorkspace = t3lib_div::_GP('changeWorkspace');
|
||
$this->changeWorkspacePreview = t3lib_div::_GP('changeWorkspacePreview');
|
||
$this->workspaceAccess = $this->hasWorkspaceAccess();
|
||
}
|
||
/**
|
||
... | ... | |
* @return string workspace selector as HTML select
|
||
*/
|
||
public function render() {
|
||
|
||
if(!$this->workspaceAccess) {
|
||
return '';
|
||
}
|
||
|
||
$this->addJavascriptToBackend();
|
||
$this->changeWorkspace();
|
||
... | ... | |
public function getAdditionalAttributes() {
|
||
return ' id="workspace-selector"';
|
||
}
|
||
|
||
/**
|
||
* returns if user has access to workspaces
|
||
*
|
||
* @return boolean
|
||
*/
|
||
private function hasWorkspaceAccess() {
|
||
$MCONF = array();
|
||
include('mod/user/ws/conf.php');
|
||
return $GLOBALS['BE_USER']->modAccess(array('name' => 'user', 'access' => 'user,group'), false) && $GLOBALS['BE_USER']->modAccess($MCONF, false);
|
||
}
|
||
|
||
}
|
||
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/classes/class.workspaceselector.php']) {
|
||
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/classes/class.workspaceselector.php']);
|
||
}
|
||
?>
|
||
?>
|