Skip to content

Commit

Permalink
RBAC: Rix duplicate global roles for FILTER_ALL
Browse files Browse the repository at this point in the history
  • Loading branch information
ingoj authored and kergomard committed Jan 15, 2025
1 parent 8ea4db2 commit f76aef3
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions components/ILIAS/AccessControl/classes/class.ilRbacReview.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

declare(strict_types=1);

declare(strict_types=1);

/**
* class ilRbacReview
* Contains Review functions of core Rbac.
Expand Down Expand Up @@ -868,34 +866,29 @@ public function getRolesByFilter(int $a_filter = 0, int $a_user_id = 0, string $
{
$assign = "y";
switch ($a_filter) {
// all (assignable) roles
case self::FILTER_ALL:
yield from $this->getAssignableRolesGenerator(true, true, $title_filter);
return;

// all (assignable) global roles
// no break
case self::FILTER_ALL_GLOBAL:
$where = 'WHERE ' . $this->db->in('rbac_fa.rol_id', $this->getGlobalRoles(), false, 'integer') . ' ';
break;

// all (assignable) local roles
case self::FILTER_ALL_LOCAL:
case self::FILTER_INTERNAL:
case self::FILTER_NOT_INTERNAL:
$where = 'WHERE ' . $this->db->in('rbac_fa.rol_id', $this->getGlobalRoles(), true, 'integer');
break;

// all role templates
case self::FILTER_TEMPLATES:
$where = "WHERE object_data.type = 'rolt'";
$assign = "n";
break;

// only assigned roles, handled by ilObjUserGUI::roleassignmentObject()
case 0:
default:
if (!$a_user_id) {
return [];
return;
}

$where = 'WHERE ' . $this->db->in(
Expand Down

0 comments on commit f76aef3

Please sign in to comment.