Skip to content

Commit d6e0cbf

Browse files
kergomardfwolf-ilias
authored andcommitted
Object: Fix Missing RBAC-Checks in Translations
See: https://mantis.ilias.de/view.php?id=44737 Signed-off-by: Fabian Wolf <[email protected]>
1 parent 87aac06 commit d6e0cbf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Services/Object/classes/Translation/class.ilObjectTranslationGUI.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class ilObjectTranslationGUI
3636
public const CMD_SET_FALLBACK = "setFallback";
3737
protected ilToolbarGUI $toolbar;
3838
protected ilObjUser $user;
39+
protected ilAccess $access;
3940
protected ilLanguage $lng;
4041
protected ilCtrl $ctrl;
4142
protected ilGlobalTemplateInterface $tpl;
@@ -57,6 +58,7 @@ public function __construct($obj_gui)
5758

5859
$this->toolbar = $DIC->toolbar();
5960
$this->user = $DIC->user();
61+
$this->access = $DIC['ilAccess'];
6062
$this->lng = $DIC->language();
6163
$this->ctrl = $DIC->ctrl();
6264
$this->tpl = $DIC["tpl"];
@@ -182,6 +184,11 @@ public function executeCommand(): void
182184

183185
$this->ctrl->getNextClass($this);
184186
$cmd = $this->ctrl->getCmd(self::CMD_LIST_TRANSLATIONS);
187+
if (!$this->access->checkAccess('write', '', $this->obj_gui->getRefId())) {
188+
$this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'));
189+
$this->ctrl->redirect($this->obj_gui);
190+
}
191+
185192
if (in_array($cmd, $commands)) {
186193
$this->$cmd();
187194
}

0 commit comments

Comments
 (0)