Skip to content

Commit

Permalink
Merge branch 'trunk' of github.com:ILIAS-eLearning/ILIAS into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
smeyer-ilias committed Aug 12, 2024
2 parents 36896c1 + 269324f commit f5ae32b
Show file tree
Hide file tree
Showing 414 changed files with 15,045 additions and 3,696 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

class ilAccessCustomRBACOperationAddedObjective implements Setup\Objective
{
private const NO_DIC_FOUND = 'There is no $DIC.';

protected string $id;
protected string $title;
protected string $class;
Expand Down Expand Up @@ -125,7 +127,7 @@ public function achieve(Environment $environment): Environment
$db->insert("rbac_ta", $values);
}

$GLOBALS["DIC"] = $dic;
$this->resetDIC($dic);
return $environment;
}

Expand Down Expand Up @@ -159,8 +161,7 @@ public function isApplicable(Environment $environment): bool
}
}

$GLOBALS["DIC"] = $dic;

$this->resetDIC($dic);
return count($this->types) && in_array($this->class, ['create', 'object', 'general']);
}

Expand All @@ -172,17 +173,26 @@ protected function initEnvironment(Setup\Environment $environment)
// subcomponents of the various readers to run. This is a memento to the
// fact, that dependency injection is something we want. Currently, every
// component could just service locate the whole world via the global $DIC.
$DIC = [];
if (isset($GLOBALS["DIC"])) {
$DIC = $GLOBALS["DIC"];
$DIC = self::NO_DIC_FOUND;
if (array_key_exists('DIC', $GLOBALS)) {
$DIC = $GLOBALS['DIC'];
}
$GLOBALS["DIC"] = new DI\Container();
$GLOBALS["DIC"]["ilDB"] = $db;
$GLOBALS['DIC'] = new DI\Container();
$GLOBALS['DIC']['ilDB'] = $db;

if (!defined("ILIAS_ABSOLUTE_PATH")) {
define("ILIAS_ABSOLUTE_PATH", dirname(__FILE__, 6));
if (!defined('ILIAS_ABSOLUTE_PATH')) {
define('ILIAS_ABSOLUTE_PATH', dirname(__FILE__, 6));
}

return $DIC;
}

protected function resetDIC($dic): void
{
if ($dic !== self::NO_DIC_FOUND) {
$GLOBALS['DIC'] = $dic;
return;
}
unset($GLOBALS['DIC']);
}
}
4 changes: 2 additions & 2 deletions components/ILIAS/AccessControl/classes/class.ilObjRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,9 @@ public function __getPermissionDefinitions(): array
return [$rbac_objects, $rbac_operations];
}

public static function isAutoGenerated(int $a_role_id): bool
public function isAutoGenerated(): bool
{
return substr(ilObject::_lookupTitle($a_role_id), 0, 3) == 'il_';
return substr($this->title, 0, 3) == 'il_';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ protected function initRolesFromPOST(): array
return [];
}

public function returnObject(): void
{
$this->viewObject();
}

public function viewObject(): void
{
$this->tabs_gui->activateTab('view');
Expand All @@ -136,7 +141,7 @@ public function viewObject(): void
$this->toolbar->addComponent(
$this->ui_factory->link()->standard(
$this->lng->txt('rolf_create_role'),
$this->ctrl->getLinkTarget($this, 'create')
$this->ctrl->getLinkTargetByClass(ilObjRoleGUI::class, 'create')
)
);
}
Expand All @@ -145,7 +150,7 @@ public function viewObject(): void
$this->toolbar->addComponent(
$this->ui_factory->link()->standard(
$this->lng->txt('rolf_create_rolt'),
$this->ctrl->getLinkTarget($this, 'create')
$this->ctrl->getLinkTargetByClass(ilObjRoleTemplateGUI::class, 'create')
)
);
$this->ctrl->clearParameters($this);
Expand Down Expand Up @@ -752,7 +757,7 @@ protected function initSettingsForm(): ilPropertyFormGUI
$admin->setValue((string) 1);
$form->addItem($admin);

$check = new ilCheckboxInputGui($this->lng->txt('rbac_log'), 'rbac_log');
$check = new ilCheckboxInputGUI($this->lng->txt('rbac_log'), 'rbac_log');
$check->setInfo($this->lng->txt('rbac_log_info'));
$check->setChecked($privacy->enabledRbacLog());
$form->addItem($check);
Expand Down
Loading

0 comments on commit f5ae32b

Please sign in to comment.