19 declare(strict_types=1);
60 $this->db = $DIC->database();
74 $q =
"SELECT DISTINCT(obj_id) obj_id FROM object_data " .
76 "AND type IN('role','rolt')" .
78 $r = $this->db->query($q);
80 return (
int) $row->obj_id;
101 foreach ($roles as $role) {
102 $id = (
int) $role[
"obj_id"];
103 $role[
"parent"] = (
int) $ref_id;
104 $parent_roles[
$id] = $role;
106 if (!array_key_exists($role[
'obj_id'], $role_hierarchy)) {
126 $tree = $DIC->repositoryTree();
128 $pathIds = $tree->getPathId($a_endnode_id);
144 $query =
"SELECT * FROM object_data " .
145 "JOIN rbac_fa ON obj_id = rol_id " .
147 "AND object_data.obj_id = rbac_fa.rol_id " .
148 "AND rbac_fa.parent = " . $this->db->quote($a_ref_id,
'integer') .
" ";
151 while ($row = $this->db->fetchAssoc(
$res)) {
152 $row[
"desc"] = $row[
"description"];
153 $row[
"user_id"] = (
int) $row[
"owner"];
154 $row[
'obj_id'] = (
int) $row[
'obj_id'];
155 $row[
'rol_id'] = (
int) $row[
'rol_id'];
156 $row[
'parent'] = (
int) $row[
'parent'];
168 bool $a_templates =
false,
169 bool $a_internal_roles =
false,
170 string $title_filter =
'' 172 return iterator_to_array(
185 bool $a_templates =
false,
186 bool $a_internal_roles =
false,
187 string $title_filter =
'' 190 $query =
"SELECT * FROM object_data " .
191 "JOIN rbac_fa ON obj_id = rol_id " .
193 "AND rbac_fa.assign = 'y' ";
195 if (strlen($title_filter)) {
196 $query .= (
' AND ' . $this->db->like(
204 while ($row = $this->db->fetchAssoc(
$res)) {
205 $row[
"description"] = (string) $row[
"description"];
206 $row[
"desc"] = $row[
"description"];
207 $row[
"user_id"] = (
int) $row[
"owner"];
208 $row[
'obj_id'] = (
int) $row[
'obj_id'];
209 $row[
'parent'] = (
int) $row[
'parent'];
222 $tree = $DIC->repositoryTree();
223 $query =
'SELECT rol_id FROM rbac_fa fa ' .
224 'JOIN tree t1 ON t1.child = fa.parent ' .
225 'JOIN object_data obd ON fa.rol_id = obd.obj_id ' .
226 'WHERE assign = ' . $this->db->quote(
'y',
'text') .
' ' .
227 'AND obd.type = ' . $this->db->quote(
'role',
'text') .
' ' .
228 'AND t1.child IN (' .
229 $tree->getSubTreeQuery($ref_id, array(
'child')) .
' ' .
236 $role_list[] = (
int) $row->rol_id;
246 $query =
"SELECT fa.*, rd.* " .
247 "FROM object_data rd " .
248 "JOIN rbac_fa fa ON rd.obj_id = fa.rol_id " .
249 "WHERE fa.assign = 'y' " .
250 "AND fa.parent = " . $this->db->quote($a_ref_id,
'integer') .
" ";
254 while ($row = $this->db->fetchAssoc(
$res)) {
255 $row[
'rol_id'] = (
int) $row[
'rol_id'];
256 $row[
'obj_id'] = (
int) $row[
'obj_id'];
258 $roles_data[] = $row;
270 $where =
"WHERE " . $this->db->in(
'object_data.type', array(
'role',
'rolt'),
false,
'text') .
" ";
272 $where =
"WHERE " . $this->db->in(
'object_data.type', array(
'role'),
false,
'text') .
" ";
286 foreach ($a_role_list as
$key => $val) {
294 $role_list_entry[
'role_type'] = $this->
buildRoleType($role_list_entry);
296 return $role_list_entry;
301 if ($role_list_entry[
'type'] ===
'rolt') {
305 if ($role_list_entry[
'assign'] !==
'y') {
318 if ($value ===
'y') {
330 $query =
'select count(distinct(ua.usr_id)) as num from rbac_ua ua ' .
331 'join object_data on ua.usr_id = obj_id ' .
332 'join usr_data ud on ua.usr_id = ud.usr_id ' .
333 'where ' . $this->db->in(
'rol_id', $a_roles,
false,
'integer');
336 if (
$res->numRows() > 0) {
338 return isset($row->num) && is_numeric($row->num) ? (
int) $row->num : 0;
351 if (isset(self::$assigned_users_cache[$a_rol_id])) {
352 return self::$assigned_users_cache[$a_rol_id];
356 $query =
"SELECT usr_id FROM rbac_ua WHERE rol_id= " . $this->db->quote($a_rol_id,
'integer');
358 while ($row = $this->db->fetchAssoc(
$res)) {
359 $result_arr[] = (
int) $row[
"usr_id"];
361 self::$assigned_users_cache[$a_rol_id] = $result_arr;
368 public function isAssigned(
int $a_usr_id,
int $a_role_id): bool
370 if (isset(self::$is_assigned_cache[$a_role_id][$a_usr_id])) {
371 return self::$is_assigned_cache[$a_role_id][$a_usr_id];
374 $this->db->setLimit(1, 0);
375 $query =
"SELECT usr_id FROM rbac_ua WHERE " .
376 "rol_id= " . $this->db->quote($a_role_id,
'integer') .
" " .
379 $is_assigned =
$res->numRows() == 1;
380 self::$is_assigned_cache[$a_role_id][$a_usr_id] = $is_assigned;
396 $this->db = $DIC[
'ilDB'];
398 $this->db->setLimit(1, 0);
399 $query =
"SELECT usr_id FROM rbac_ua WHERE " .
400 $this->db->in(
'rol_id', $a_role_ids,
false,
'integer') .
404 return $this->db->numRows(
$res) == 1;
414 $query =
"SELECT rol_id FROM rbac_ua WHERE usr_id = " . $this->db->quote($a_usr_id,
'integer');
418 while ($row = $this->db->fetchObject(
$res)) {
419 $role_arr[] = (
int) $row->rol_id;
429 $query =
"SELECT ua.rol_id FROM rbac_ua ua " .
430 "JOIN rbac_fa fa ON ua.rol_id = fa.rol_id " .
431 "WHERE usr_id = " . $this->db->quote($a_usr_id,
'integer') .
' ' .
437 while ($row = $this->db->fetchObject(
$res)) {
438 $role_arr[] = $row->rol_id;
440 return $role_arr !== [] ? $role_arr : [];
453 $query =
"SELECT * FROM rbac_fa " .
454 "WHERE rol_id = " . $this->db->quote($a_rol_id,
'integer') .
" " .
455 "AND parent = " . $this->db->quote($a_ref_id,
'integer') .
" ";
457 while ($row = $this->db->fetchObject(
$res)) {
458 return $row->assign ==
'y';
465 $query =
"SELECT * FROM rbac_fa WHERE rol_id = " . $this->db->quote($a_role_id,
'integer') .
' ' .
466 "AND assign = " . $this->db->quote(
'y',
'text');
468 return $res->numRows() > 1;
484 $where =
" AND assign ='y'";
487 $query =
"SELECT DISTINCT parent FROM rbac_fa " .
488 "WHERE rol_id = " . $this->db->quote($a_rol_id,
'integer') .
" " . $where .
" ";
492 while ($row = $this->db->fetchObject(
$res)) {
493 $folders[] = (
int) $row->parent;
504 if ($a_assignable_only ===
true) {
505 $and =
'AND assign = ' . $this->db->quote(
'y',
'text');
507 $query =
"SELECT rol_id FROM rbac_fa " .
508 "WHERE parent = " . $this->db->quote($a_ref_id,
'integer') .
" " .
514 while ($row = $this->db->fetchObject(
$res)) {
515 $role_ids[] = (
int) $row->rol_id;
533 if ($a_nonassignable ===
false) {
534 $and =
" AND assign='y'";
537 $query =
"SELECT rol_id FROM rbac_fa " .
538 "WHERE parent = " . $this->db->quote($a_ref_id,
'integer') .
" " .
543 while ($row = $this->db->fetchObject(
$res)) {
544 $rol_id[] = (
int) $row->rol_id;
568 $lroles[] = $role_id;
582 $lroles[] = $role_id;
594 $ga[] = array(
'obj_id' => $role_id,
595 'role_type' =>
'global' 609 $ga[] = array(
'obj_id' => $role_id,
610 'role_type' =>
'global' 622 $query =
'SELECT * FROM rbac_fa ' .
623 'WHERE rol_id = ' . $this->db->quote($a_role_id,
'integer') .
' ' .
624 'AND parent = ' . $this->db->quote($a_parent_id,
'integer');
626 return (
bool)
$res->numRows();
634 $query =
'SELECT * FROM rbac_operations ORDER BY ops_id ';
637 while ($row = $this->db->fetchObject(
$res)) {
638 $ops[] = array(
'ops_id' => (
int) $row->ops_id,
639 'operation' => $row->operation,
640 'description' => $row->description
651 $query =
'SELECT * FROM rbac_operations WHERE ops_id = ' . $this->db->quote($ops_id,
'integer');
654 while ($row = $this->db->fetchObject(
$res)) {
655 $ops = array(
'ops_id' => (
int) $row->ops_id,
656 'operation' => $row->operation,
657 'description' => $row->description
672 $query =
"SELECT ops_id,type FROM rbac_templates " .
673 "WHERE rol_id = " . $this->db->quote($a_rol_id,
'integer') .
" " .
674 "AND parent = " . $this->db->quote($a_parent,
'integer');
678 while ($row = $this->db->fetchObject(
$res)) {
679 $ops_arr[$row->type][] = (
int) $row->ops_id;
689 $query =
'SELECT * FROM rbac_pa ' .
690 'WHERE ref_id = ' . $this->db->quote($a_ref_id,
'integer') .
' ' .
691 'AND rol_id = ' . $this->db->quote($a_role_id,
'integer') .
' ';
695 return unserialize($row[
'ops_id']);
708 if ($a_parent == 0) {
712 $query =
"SELECT ops_id FROM rbac_templates " .
713 "WHERE type =" . $this->db->quote($a_type,
'text') .
" " .
714 "AND rol_id = " . $this->db->quote($a_rol_id,
'integer') .
" " .
715 "AND parent = " . $this->db->quote($a_parent,
'integer');
717 while ($row = $this->db->fetchObject(
$res)) {
718 $ops_arr[] = $row->ops_id;
725 $query =
"SELECT * FROM rbac_pa " .
726 "WHERE rol_id = " . $this->db->quote($a_role_id,
'integer') .
" " .
727 "AND ref_id = " . $this->db->quote($a_ref_id,
'integer') .
" ";
731 while ($row = $this->db->fetchObject(
$res)) {
732 $ops = (array) unserialize($row->ops_id);
742 $query =
'SELECT * FROM rbac_ta ta JOIN rbac_operations o ON ta.ops_id = o.ops_id ' .
743 'WHERE typ_id = ' . $this->db->quote($a_typ_id,
'integer') .
' ' .
748 while ($row = $this->db->fetchObject(
$res)) {
749 $ops_id[] = (
int) $row->ops_id;
759 $query =
"SELECT * FROM object_data WHERE type = 'typ' AND title = " . $this->db->quote($a_type,
'text') .
" ";
772 if ($a_class !=
'create') {
773 $condition =
"AND class != " . $this->db->quote(
'create',
'text');
775 $condition =
"AND class = " . $this->db->quote(
'create',
'text');
778 $query =
"SELECT ro.ops_id FROM rbac_operations ro " .
779 "JOIN rbac_ta rt ON ro.ops_id = rt.ops_id " .
780 "JOIN object_data od ON rt.typ_id = od.obj_id " .
781 "WHERE type = " . $this->db->quote(
'typ',
'text') .
" " .
782 "AND title = " . $this->db->quote($a_type,
'text') .
" " .
784 "ORDER BY op_order ";
789 $ops[] = (
int) $row->ops_id;
800 $query =
'SELECT parent p FROM rbac_fa ' .
801 'WHERE assign = ' . $this->db->quote(
'n',
'text') .
' ' .
802 'AND rol_id = ' . $this->db->quote($a_rol_id,
'integer') .
' ';
804 if ($a_filter !== []) {
805 $query .= (
'AND ' . $this->db->in(
'parent', (array) $a_filter,
false,
'integer'));
811 $parent[] = (
int) $row->p;
823 $r = $this->db->query($q);
828 '%s::isDeleted(): Role folder with ref_id %s not found!',
835 return $row->tree < 0;
854 case self::FILTER_ALL:
859 case self::FILTER_ALL_GLOBAL:
860 $where =
'WHERE ' . $this->db->in(
'rbac_fa.rol_id', $this->
getGlobalRoles(),
false,
'integer') .
' ';
864 case self::FILTER_ALL_LOCAL:
865 case self::FILTER_INTERNAL:
866 case self::FILTER_NOT_INTERNAL:
867 $where =
'WHERE ' . $this->db->in(
'rbac_fa.rol_id', $this->
getGlobalRoles(),
true,
'integer');
870 case self::FILTER_TEMPLATES:
871 $where =
"WHERE object_data.type = 'rolt'";
882 $where =
'WHERE ' . $this->db->in(
891 $query =
"SELECT * FROM object_data " .
892 "JOIN rbac_fa ON obj_id = rol_id " .
894 "AND rbac_fa.assign = " . $this->db->quote($assign,
'text') .
" ";
896 if (strlen($title_filter)) {
897 $query .= (
' AND ' . $this->db->like(
900 '%' . $title_filter .
'%' 905 while ($row = $this->db->fetchAssoc(
$res)) {
906 $row[
'title'] = $row[
'title'] ??
'';
907 $prefix = substr($row[
'title'], 0, 3) ==
"il_";
910 if ($a_filter == 4 && !$prefix) {
915 if ($a_filter == 5 && $prefix) {
919 $row[
'description'] = $row[
'description'] ??
'';
920 $row[
"desc"] = $row[
"description"];
921 $row[
"user_id"] = (
int) $row[
"owner"];
922 $row[
'obj_id'] = (
int) $row[
'obj_id'];
923 $row[
'rol_id'] = (
int) $row[
'rol_id'];
924 $row[
'parent'] = (
int) $row[
'parent'];
932 $q =
"SELECT obj_id FROM object_data " .
933 "WHERE title=" . $this->db->quote($a_type,
'text') .
" AND type='typ'";
934 $r = $this->db->query($q);
936 return (
int) $row->obj_id;
949 $ilDB = $DIC->database();
950 if ($operations === []) {
954 $query =
'SELECT ops_id FROM rbac_operations ' .
955 'WHERE ' .
$ilDB->in(
'operation', $operations,
false,
'text');
959 while ($row =
$ilDB->fetchObject(
$res)) {
960 $ops_ids[] = (
int) $row->ops_id;
972 $ilDB = $DIC->database();
975 if (!is_array(self::$_opsCache)) {
976 self::$_opsCache = [];
978 $q =
"SELECT ops_id, operation FROM rbac_operations";
979 $r =
$ilDB->query($q);
981 self::$_opsCache[$row->operation] = (
int) $row->ops_id;
986 if (array_key_exists($a_operation, self::$_opsCache)) {
987 return self::$_opsCache[$a_operation];
1001 $ilDB = $DIC->database();
1004 foreach ($a_type_arr as
$type) {
1005 $operations[] = (
'create_' .
$type);
1008 if ($operations === []) {
1012 $query =
'SELECT ops_id, operation FROM rbac_operations ' .
1013 'WHERE ' .
$ilDB->in(
'operation', $operations,
false,
'text');
1018 while ($row =
$ilDB->fetchObject(
$res)) {
1019 $type_arr = explode(
'_', $row->operation);
1020 $type = $type_arr[1];
1022 $ops_ids[
$type] = (
int) $row->ops_id;
1032 $query =
'SELECT protected FROM rbac_fa ' .
1036 if ($row->protected ===
'y') {
1045 $query =
'SELECT blocked from rbac_fa ' .
1046 'WHERE rol_id = ' . $this->db->quote($a_role_id,
'integer') .
' ' .
1047 'AND parent = ' . $this->db->quote($a_ref_id,
'integer');
1050 return (
bool) $row->blocked;
1063 $tree = $DIC[
'tree'];
1068 $query =
'SELECT parent from rbac_fa ' .
1069 'WHERE rol_id = ' . $this->db->quote($a_role_id,
'integer') .
' ' .
1070 'AND blocked = ' . $this->db->quote(1,
'integer');
1075 $parent_ids[] = (
int) $row->parent;
1078 foreach ($parent_ids as $parent_id) {
1079 if ($tree->isGrandChild($parent_id, $a_ref_id)) {
1092 $rbacsystem = $DIC->rbac()->system();
1097 $leveladmin =
false;
1099 foreach ($a_role_hierarchy as $role_id => $rolf_id) {
1100 if ($leveladmin ==
true) {
1101 $a_parent_roles[$role_id][
'protected'] =
false;
1105 if ($a_parent_roles[$role_id][
'protected'] ==
true) {
1106 $arr_lvl_roles_user = array_intersect(
1108 array_keys($a_role_hierarchy, $rolf_id)
1111 foreach ($arr_lvl_roles_user as $lvl_role_id) {
1113 $rolf = $a_parent_roles[$role_id][
'parent'];
1114 if ($rbacsystem->checkPermission($rolf, $lvl_role_id,
'edit_permission')) {
1115 $a_parent_roles[$role_id][
'protected'] =
false;
1120 return $a_parent_roles;
1130 $ilDB = $DIC->database();
1134 'SELECT * FROM rbac_operations ' .
1135 'JOIN rbac_ta ON rbac_operations.ops_id = rbac_ta.ops_id ' .
1136 'JOIN object_data ON rbac_ta.typ_id = object_data.obj_id ' .
1137 'WHERE object_data.title = %s ' .
1138 'AND object_data.type = %s ' .
1139 'ORDER BY op_order ASC',
1140 $ilDB->quote($a_type,
'text'),
1141 $ilDB->quote(
'typ',
'text')
1144 $query =
'SELECT * FROM rbac_operations ORDER BY op_order ASC';
1147 while ($row =
$ilDB->fetchAssoc(
$res)) {
1149 "ops_id" => (
int) $row[
'ops_id'],
1150 "operation" => $row[
'operation'],
1151 "desc" => $row[
'description'],
1152 "class" => $row[
'class'],
1153 "order" => (
int) $row[
'op_order']
1162 foreach ($a_ops_arr as $ops) {
1163 $arr[$ops[
'class']][] = array(
'ops_id' => (
int) $ops[
'ops_id'],
1164 'name' => $ops[
'operation']
1177 static $obj_cache = [];
1179 if (isset($obj_cache[$a_role_id]) && $obj_cache[$a_role_id]) {
1180 return $obj_cache[$a_role_id];
1183 $query =
'SELECT obr.obj_id FROM rbac_fa rfa ' .
1184 'JOIN object_reference obr ON rfa.parent = obr.ref_id ' .
1185 'WHERE assign = ' . $this->db->quote(
'y',
'text') .
' ' .
1186 'AND rol_id = ' . $this->db->quote($a_role_id,
'integer') .
' ' .
1187 'AND deleted IS NULL';
1190 $obj_cache[$a_role_id] = 0;
1191 while ($row = $this->db->fetchObject(
$res)) {
1192 $obj_cache[$a_role_id] = (
int) $row->obj_id;
1194 return $obj_cache[$a_role_id];
1199 $query =
'SELECT parent p_ref FROM rbac_fa ' .
1200 'WHERE rol_id = ' . $this->db->quote($a_role_id,
'integer') .
' ' .
1201 'AND assign = ' . $this->db->quote(
'y',
'text');
1205 return (
int) $row->p_ref;
1217 if ($rolf_list !== []) {
1218 foreach ($rolf_list as $rolf) {
1232 $query =
"SELECT * FROM object_data " .
1233 "JOIN rbac_fa ON object_data.obj_id = rbac_fa.rol_id " .
1235 "AND rbac_fa.assign = 'y' " .
1236 'AND ' . $this->db->in(
'object_data.obj_id', $role_ids,
false,
'integer');
1240 while ($row = $this->db->fetchAssoc(
$res)) {
1241 $row[
"desc"] = $row[
"description"];
1242 $row[
"user_id"] = (
int) $row[
"owner"];
1243 $role_list[] = $row;
1256 $this->db = $DIC[
'ilDB'];
1258 $query =
'SELECT ta.typ_id, obj.title, ops.ops_id, ops.operation FROM rbac_ta ta ' .
1259 'JOIN object_data obj ON obj.obj_id = ta.typ_id ' .
1260 'JOIN rbac_operations ops ON ops.ops_id = ta.ops_id ';
1265 while ($row = $this->db->fetchObject(
$res)) {
1266 $info[$counter][
'typ_id'] = (
int) $row->typ_id;
1267 $info[$counter][
'type'] = $row->title;
1268 $info[$counter][
'ops_id'] = (
int) $row->ops_id;
1269 $info[$counter][
'operation'] = $row->operation;
1298 return substr($title, 0, 3) ==
'il_';
1301 public function getParentOfRole(
int $role_id, ?
int $object_ref = null): ?
int 1305 $tree = $DIC[
'tree'];
1312 $path_ids = $tree->getPathId($object_ref);
1315 while (
$ref_id = array_pop($path_ids)) {
1317 foreach ($roles as $role) {
1318 if ((
int) $role[
'obj_id'] === $role_id) {
1331 $and = (
'AND assign = ' . $this->db->quote(
'y',
'text'));
1336 $query =
'SELECT * FROM rbac_fa ' .
1337 'WHERE rol_id = ' . $this->db->quote($a_role_id,
'integer') .
' ' .
1341 return (
int) $row->parent;
1351 $query =
"SELECT ops_id FROM rbac_pa JOIN rbac_ua " .
1352 "ON (rbac_pa.rol_id = rbac_ua.rol_id) " .
1353 "WHERE rbac_ua.usr_id = " . $this->db->quote($a_user_id,
'integer') .
" " .
1354 "AND rbac_pa.ref_id = " . $this->db->quote($a_ref_id,
'integer') .
" ";
1358 while ($row = $this->db->fetchObject(
$res)) {
1359 $ops = unserialize($row->ops_id);
1360 $all_ops = array_merge($all_ops, $ops);
1362 $all_ops = array_unique($all_ops);
1364 $set = $this->db->query(
"SELECT operation FROM rbac_operations " .
1365 " WHERE " . $this->db->in(
"ops_id", $all_ops,
false,
"integer"));
1367 while ($rec = $this->db->fetchAssoc($set)) {
1368 $perms[] = $rec[
"operation"];
1378 self::$is_assigned_cache[$a_role_id][$a_user_id] = $a_value;
1383 return self::$is_assigned_cache[$a_role_id][$a_user_id];
1391 self::$is_assigned_cache = [];
1392 self::$assigned_users_cache = [];
1399 $ilDB = $DIC->database();
1403 "SELECT ops_id" . PHP_EOL
1404 .
"FROM rbac_operations" . PHP_EOL
1405 .
"WHERE operation = " .
$ilDB->quote($operation,
"text") . PHP_EOL
1414 return (
int) $row[
"ops_id"] ?? null;
1421 $ilDB = $DIC->database();
1425 "SELECT typ_id" . PHP_EOL
1426 .
"FROM rbac_ta" . PHP_EOL
1427 .
"WHERE typ_id = " .
$ilDB->quote($type_id,
"integer") . PHP_EOL
1428 .
"AND ops_id = " .
$ilDB->quote($ops_id,
"integer") . PHP_EOL
1431 return (
bool)
$ilDB->numRows(
$ilDB->query($sql));
getRoleListByObject(int $a_ref_id, bool $a_templates=false)
Returns a list of roles in an container.
clearCaches()
Clear assigned users caches.
getOperationsOnType(int $a_typ_id)
all possible operations of a type
getRolesForIDs(array $role_ids, bool $use_templates)
roleExists(string $a_title, int $a_id=0)
Checks if a role already exists.
static getLogger(string $a_component_id)
Get component logger.
getRoleOperationsOnObject(int $a_role_id, int $a_ref_id)
assignedUsers(int $a_rol_id)
get all assigned users to a given role public
getOperation(int $ops_id)
get one operation by operation id
isBlockedAtPosition(int $a_role_id, int $a_ref_id)
getUserPermissionsOnObject(int $a_user_id, int $a_ref_id)
Get all user permissions on an object.
getRolesOfObject(int $a_ref_id, bool $a_assignable_only=false)
Get roles of object.
setRoleTypeAndProtection(array $role_list_entry)
getOperationsOnTypeString(string $a_type)
all possible operations of a type
getLocalRoles(int $a_ref_id)
Get local roles of object.
__setTemplateFilter(bool $a_templates)
get roles and templates or only roles; returns string for where clause
isSystemGeneratedRole(int $a_role_id)
Check if the role is system generate role or role template.
static _getOperationIdsByName(array $operations)
get ops_id's by name.
getObjectReferenceOfRole(int $a_role_id)
getOperationAssignment()
get operation assignments
const FILTER_NOT_INTERNAL
__setRoleType(array $a_role_list)
computes role type in role list array: global: roles in ROLE_FOLDER_ID local: assignable roles in oth...
isDeleted(int $a_node_id)
Checks if a rolefolder is set as deleted (negative tree_id)
getAllOperationsOfRole(int $a_rol_id, int $a_parent=0)
get all possible operations of a specific role The ref_id of the role folder (parent object) is neces...
setAssignedCacheEntry(int $a_role_id, int $a_user_id, bool $a_value)
set entry of assigned_chache
getLocalPolicies(int $a_ref_id)
Get all roles with local policies.
__getParentRoles(array $a_path, bool $a_templates)
Note: This function performs faster than the new getParentRoles function, because it uses database in...
static _getOperationList(string $a_type='')
get operation list by object type
static lookupCreateOperationIds(array $a_type_arr)
Lookup operation ids.
getOperationsByTypeAndClass(string $a_type, string $a_class)
Get operations by type and class.
getFoldersAssignedToRole(int $a_rol_id, bool $a_assignable=false)
Returns an array of objects assigned to a role.
static array $is_assigned_cache
getGlobalRolesArray()
get only 'global' roles
getAssignableChildRoles(int $a_ref_id)
Get all assignable roles directly under a specific node.
static _lookupTitle(int $obj_id)
isRoleAssignedToObject(int $a_role_id, int $a_parent_id)
Check if role is assigned to an object.
getTypeId(string $a_type)
buildRoleType(array $role_list_entry)
getParentRoleIds(int $a_endnode_id, bool $a_templates=false)
Get an array of parent role ids of all parent roles, if last parameter is set true you get also all p...
isAssigned(int $a_usr_id, int $a_role_id)
check if a specific user is assigned to specific role
isDeleteable(int $a_role_id, int $a_rolf_id)
Check if role is deleteable at a specific position.
getGlobalRoles()
get only 'global' roles
getAssignableRolesInSubtree(int $ref_id)
Returns a list of assignable roles in a subtree of the repository.
getNumberOfAssignedUsers(array $a_roles)
Get the number of assigned users to roles (not properly deleted user accounts are not counted) ...
__setProtectedStatus(array $a_parent_roles, array $a_role_hierarchy, int $a_ref_id)
hasMultipleAssignments(int $a_role_id)
static _getCustomRBACOperationId(string $operation, \ilDBInterface $ilDB=null)
isBlockedInUpperContext(int $a_role_id, int $a_ref_id)
Check if role is blocked in upper context.
isGlobalRole(int $a_role_id)
Check if role is a global role.
static _getOperationIdByName(string $a_operation)
get operation id by name of operation
getGlobalAssignableRoles()
get only 'global' roles (with flag 'assign_users')
__construct()
Constructor public.
getOperations()
get all possible operations
static _groupOperationsByClass(array $a_ops_arr)
getAssignableRolesGenerator(bool $a_templates=false, bool $a_internal_roles=false, string $title_filter='')
getAssignedCacheEntry(int $a_role_id, int $a_user_id)
getRolesOfRoleFolder(int $a_ref_id, bool $a_nonassignable=true)
get all roles of a role folder including linked local roles that are created due to stopped inheritan...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
assignedGlobalRoles(int $a_usr_id)
Get assigned global roles for an user.
getActiveOperationsOfRole(int $a_ref_id, int $a_role_id)
Get active operations for a role.
isRoleDeleted(int $a_role_id)
return if role is only attached to deleted role folders
static _isRBACOperation(int $type_id, int $ops_id, \ilDBInterface $ilDB=null)
static _getAssignUsersStatus(int $a_role_id)
isAssignable(int $a_rol_id, int $a_ref_id)
Check if its possible to assign users.
static _lookupType(int $id, bool $reference=false)
getRolesByFilter(int $a_filter=0, int $a_user_id=0, string $title_filter='')
getOperationsOfRole(int $a_rol_id, string $a_type, int $a_parent=0)
get all possible operations of a specific role The ref_id of the role folder (parent object) is neces...
getRoleFolderOfRole(int $a_role_id)
getAssignableRoles(bool $a_templates=false, bool $a_internal_roles=false, string $title_filter='')
Returns a list of all assignable roles.
getObjectsWithStopedInheritance(int $a_rol_id, array $a_filter=[])
get all objects in which the inheritance of role with role_id was stopped the function returns all re...
buildProtectionByStringValue(string $value)
assignedRoles(int $a_usr_id)
get all assigned roles to a given user
getObjectOfRole(int $a_role_id)
Get object id of objects a role is assigned to.
static array $assigned_users_cache
isAssignedToAtLeastOneGivenRole(int $a_usr_id, array $a_role_ids)
check if a specific user is assigned to at least one of the given role ids.
isProtected(int $a_ref_id, int $a_role_id)
ref_id not used yet.