3 declare(strict_types=1);
29 public static function getList(
string $a_str): string
33 $ilDB = $DIC->database();
34 $ilDB->setLimit(20, 0);
35 $query =
"SELECT o1.title role,o2.title container FROM object_data o1 " .
36 "JOIN rbac_fa fa ON o1.obj_id = rol_id " .
39 "JOIN object_reference obr ON ref_id = fa.parent " .
40 "JOIN object_data o2 ON obr.obj_id = o2.obj_id " .
41 "WHERE o1.type = 'role' " .
43 "AND (" .
$ilDB->like(
'o1.title',
'text',
'%' . $a_str .
'%') .
"OR " .
44 $ilDB->like(
'o2.title',
'text',
'%' . $a_str .
'%') .
" )" .
45 "AND fa.parent != 8 " .
46 "ORDER BY role,container";
53 $result[$counter]->value = $row->role;
54 $result[$counter]->label = $row->role .
" (" . $row->container .
")";
59 return self::getListByObject($a_str);
62 return json_encode($result, JSON_THROW_ON_ERROR);
72 $rbacreview = $DIC->rbac()->review();
73 $ilDB = $DIC->database();
77 if (strpos($a_str,
'@') !== 0) {
78 return json_encode($result, JSON_THROW_ON_ERROR);
81 $a_str = substr($a_str, 1);
83 $ilDB->setLimit(100, 0);
84 $query =
"SELECT ref_id, title FROM object_data ode " .
85 "JOIN object_reference ore ON ode.obj_id = ore.obj_id " .
86 "WHERE " .
$ilDB->like(
'title',
'text', $a_str .
'%') .
' ' .
91 foreach ($rbacreview->getRolesOfRoleFolder($row->ref_id,
false) as $rol_id) {
95 $result[$counter]->value = $role;
96 $result[$counter]->label = $role .
" (" . $row->title .
")";
100 return json_encode($result, JSON_THROW_ON_ERROR);
static getList(string $a_str)
Get completion list.
static getListByObject(string $a_str)
Get list of roles assigned to an object.
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...