Skip to content

Commit

Permalink
Object: Fix Creation Rights ItemGroup/Session
Browse files Browse the repository at this point in the history
  • Loading branch information
kergomard committed Dec 5, 2024
1 parent ad58dae commit 9c4fb16
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/ILIAS/ILIASObject/classes/class.ilObjectGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ protected function checkPermission(string $perm, string $cmd = "", string $type

protected function checkPermissionBool(string $perm, string $cmd = "", string $type = "", ?int $ref_id = null): bool
{
if ($perm == "create") {
if ($perm === "create") {
if (!$ref_id) {
$ref_id = $this->requested_ref_id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ public function listMaterials(): void
$parent_ref_id = $tree->getParentId($this->object->getRefId());
$parent_type = ilObject::_lookupType($parent_ref_id, true);
$parent_gui_class = 'ilObj' . $this->obj_definition->getClassName($parent_type) . 'GUI';
$this->ctrl->setParameterByClass($parent_gui_class, 'ref_id', $parent_ref_id);
$gui = new ILIAS\ILIASObject\Creation\AddNewItemGUI(
$this->buildAddNewItemElements(
$this->getCreatableObjectTypes(),
Expand All @@ -231,6 +232,7 @@ public function listMaterials(): void
)
);
$gui->render();
$this->ctrl->clearParameterByClass($parent_gui_class, 'ref_id');

$tab = new ilItemGroupItemsTableGUI($this->gui, $this, "listMaterials");
$tpl->setContent($tab->getHTML());
Expand Down
2 changes: 2 additions & 0 deletions components/ILIAS/Session/classes/class.ilObjSessionGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,7 @@ public function materialsObject(): void
$parent_ref_id = $this->tree->getParentId($this->object->getRefId());
$parent_type = ilObject::_lookupType($parent_ref_id, true);
$parent_gui_class = 'ilObj' . $this->obj_definition->getClassName($parent_type) . 'GUI';
$this->ctrl->setParameterByClass($parent_gui_class, 'ref_id', $parent_ref_id);
$gui = new ILIAS\ILIASObject\Creation\AddNewItemGUI(
$this->buildAddNewItemElements(
$this->getCreatableObjectTypes(),
Expand All @@ -1123,6 +1124,7 @@ public function materialsObject(): void
)
);
$gui->render();
$this->ctrl->clearParameterByClass($parent_gui_class, 'ref_id');

$this->event_items = new ilEventItems($this->object->getId());

Expand Down

0 comments on commit 9c4fb16

Please sign in to comment.