45 if (self::$instance ===
null) {
46 self::$instance =
new self();
48 self::$instance->dropTempTable(self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_SPEC_PERMISSIONS .
"_" . self::DEFAULT_ORG_UNIT_OPERATION .
"_"
49 . self::DEFAULT_CONTEXT);
50 self::$instance->dropTempTable(self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_DEFAULT_PERMISSIONS .
"_" . self::DEFAULT_ORG_UNIT_OPERATION
51 .
"_" . self::DEFAULT_CONTEXT);
52 self::$instance->dropTempTable(self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_ORGU_DEFAULT_PERMISSIONS .
"_" . self::DEFAULT_ORG_UNIT_OPERATION
53 .
"_" . self::DEFAULT_CONTEXT);
54 self::$instance->dropTempTable(self::TMP_DEFAULT_TABLE_NAME_PREFIX_CRS_MEMBERS .
"_user_id_" .
$DIC->user()->getId());
55 self::$instance->dropTempTable(self::TMP_DEFAULT_TABLE_NAME_PREFIX_ORGU_MEMBERS .
"_user_id_" .
$DIC->user()->getId());
56 self::$instance->dropTempTable(self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_USER_MATRIX .
"_" . self::DEFAULT_ORG_UNIT_OPERATION .
"_"
57 . self::DEFAULT_CONTEXT);
79 if (
$DIC->rbac()->system()->checkAccess(
'visible', SYSTEM_FOLDER_ID)) {
83 if (!
$DIC->settings()->get(
"enable_my_staff")) {
120 if (!
$DIC->settings()->get(
"enable_my_staff")) {
141 if (!
$DIC->settings()->get(
"enable_my_staff")) {
165 if (count($arr_users) > 0 && in_array($usr_id, $arr_users)) {
195 if (count($arr_usr_id) > 0) {
212 $q =
"SELECT COUNT(orgu_ua.orgu_id) AS 'cnt' FROM il_orgu_permissions AS perm
213 INNER JOIN il_orgu_ua AS orgu_ua ON orgu_ua.position_id = perm.position_id
214 INNER JOIN il_orgu_op_contexts AS contexts on contexts.id = perm.context_id AND contexts.context is not NULL
215 WHERE orgu_ua.user_id = " .
$DIC->database()->quote($user_id,
'integer') .
" AND perm.operations is not NULL AND perm.parent_id = -1";
217 $set =
$DIC->database()->query($q);
218 $rec =
$DIC->database()->fetchAssoc($set);
231 public function countOrgusOfUserWithOperationAndContext($user_id, $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION,
$context = self::DEFAULT_CONTEXT)
240 $q =
"SELECT COUNT(orgu_ua.orgu_id) AS cnt FROM il_orgu_permissions AS perm
241 INNER JOIN il_orgu_ua AS orgu_ua ON orgu_ua.position_id = perm.position_id
242 INNER JOIN il_orgu_op_contexts AS contexts on contexts.id = perm.context_id AND contexts.context = '" .
$context .
"'
243 and orgu_ua.user_id = " .
$DIC->database()->quote($user_id,
'integer') .
" AND perm.operations LIKE '%\""
244 . $operation->getOperationId() .
"\"%'
245 WHERE perm.parent_id = -1";
247 $set =
$DIC->database()->query($q);
248 $rec =
$DIC->database()->fetchAssoc($set);
264 $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION,
266 $tmp_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_USER_MATRIX
270 $tmp_table_name = $this->buildTempTableIlobjectsUserMatrixForUserOperationAndContext($user_id, $org_unit_operation_string,
$context, $tmp_table_name_prefix);
272 $q =
'SELECT usr_id FROM ' . $tmp_table_name;
274 $user_set =
$DIC->database()->query($q);
276 $arr_users = array();
278 while ($rec =
$DIC->database()->fetchAssoc($user_set)) {
279 $arr_users[$rec[
'usr_id']] = $rec[
'usr_id'];
295 foreach ($user_assignments as $user_assignment) {
296 $users[$user_assignment->getPositionId()] = $this->
getUsersForUser($user_id, $user_assignment->getPositionId());
316 $position_limitation =
'';
317 if (!is_null($position_id)) {
318 $position_limitation =
' AND orgu_ua_current_user.position_id = ' . $position_id;
321 $q =
"SELECT " . $tmp_orgu_members .
".user_id AS usr_id
323 " . $tmp_orgu_members .
"
324 INNER JOIN il_orgu_ua AS orgu_ua_current_user on orgu_ua_current_user.user_id = " .
$DIC->database()->quote($user_id,
'integer') .
"
325 INNER JOIN il_orgu_authority AS auth ON auth.position_id = orgu_ua_current_user.position_id " . $position_limitation .
"
328 /* Identische OrgUnit wie Current User; Nicht Rekursiv; Fixe Position */
329 (orgu_ua_current_user.orgu_id = " . $tmp_orgu_members .
".orgu_id AND auth.scope = 1
330 AND auth.over = " . $tmp_orgu_members .
".user_position_id AND auth.over <> -1
333 /* Identische OrgUnit wie Current User; Nicht Rekursiv; Position egal */
334 (orgu_ua_current_user.orgu_id = " . $tmp_orgu_members .
".orgu_id AND auth.scope = 1 AND auth.over = -1)
336 /* Kinder OrgUnit wie Current User */
339 " . $tmp_orgu_members .
".orgu_id = orgu_ua_current_user.orgu_id OR
340 " . $tmp_orgu_members .
".tree_path LIKE CONCAT(\"%.\",orgu_ua_current_user.orgu_id ,\".%\")
342 " . $tmp_orgu_members .
".tree_path LIKE CONCAT(\"%.\",orgu_ua_current_user.orgu_id )
348 /* Gleiche Position */
349 auth.over = " . $tmp_orgu_members .
".user_position_id AND auth.over <> -1
362 $user_set =
$DIC->database()->query($q);
364 $arr_users = array();
366 while ($rec =
$DIC->database()->fetchAssoc($user_set)) {
367 $arr_users[$rec[
'usr_id']] = $rec[
'usr_id'];
385 foreach ($user_assignments as $user_assignment) {
387 if(count($ref_ids) > 0) {
388 $ids = array_merge($ids, $ref_ids);
408 if(count($ref_ids) > 0) {
409 $ids = array_merge($ids, $ref_ids);
435 if (is_null($operation_object)) {
439 $operation_id = $operation_object->getOperationId();
442 $query =
'select ' . ($return_ref_id ?
'object_reference.ref_id' :
'object_data.obj_id') .
' from object_data ' .
443 'inner join object_reference on object_reference.obj_id = object_data.obj_id ' .
444 'where type = "' .
$context .
'" ' .
445 'AND object_reference.ref_id not in ' .
446 ' (SELECT parent_id FROM il_orgu_permissions ' .
447 ' where position_id = ' . $position_id .
' and context_id = ' . $context_id .
' and operations not like \'%"' . $operation_id .
'"%\' and parent_id <> -1)';
451 'SELECT parent_id as ref_id FROM il_orgu_permissions '
453 'SELECT obj_id FROM il_orgu_permissions INNER JOIN object_reference ON object_reference.ref_id = il_orgu_permissions.parent_id ';
454 $query .=
' where position_id = ' . $position_id .
' and context_id = ' . $context_id .
' and operations like \'%"' . $operation_id .
'"%\' and parent_id <> -1';
457 return array_map(
function ($item) use ($return_ref_id) {
458 return $return_ref_id ? $item[
'ref_id'] : $item[
'obj_id'];
473 $res =
$DIC->database()->query(
'SELECT * FROM il_orgu_permissions ' .
474 ' WHERE context_id = ' . $context_id .
' ' .
475 'AND operations LIKE \'%"' . $operation_id .
'"%\' ' .
476 'AND position_id = ' . $position_id .
' ' .
477 'AND parent_id = -1');
479 return (
bool)
$DIC->database()->numRows(
$res) > 0;
490 public function getIlobjectsAndUsersForUserOperationAndContext($user_id, $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION,
$context = self::DEFAULT_CONTEXT)
499 $tmp_table_name =
'tmp_ilobj_user_matrix_' . $operation->getOperationId();
501 $this->buildTempTableIlobjectsUserMatrixForUserOperationAndContext($user_id, $org_unit_operation_string,
$context, $tmp_table_name);
503 $q =
'SELECT * FROM ' . $tmp_table_name;
505 $user_set =
$DIC->database()->query($q);
507 $arr_user_obj = array();
509 while ($rec =
$DIC->database()->fetchAssoc($user_set)) {
510 $arr_user_obj[] = $rec;
513 return $arr_user_obj;
525 public function buildTempTableIlobjectsUserMatrixForUserOperationAndContext(
527 $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION,
529 $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_USER_MATRIX
533 $temporary_table_name = $temporary_table_name_prefix .
"_" . $org_unit_operation_string .
"_" .
$context;
542 $tmp_table_objects_specific_perimissions = $this->buildTempTableIlobjectsSpecificPermissionSetForOperationAndContext(
543 $org_unit_operation_string,
545 self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_SPEC_PERMISSIONS
548 $tmp_table_objects_default_perimissions = $this->buildTempTableIlobjectsDefaultPermissionSetForOperationAndContext(
549 $org_unit_operation_string,
551 self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_DEFAULT_PERMISSIONS
554 $tmp_table_orgunit_default_perimissions = $this->buildTempTableIlorgunitDefaultPermissionSetForOperationAndContext(
555 $org_unit_operation_string,
557 self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_ORGU_DEFAULT_PERMISSIONS
566 if ($temporary_table_name != self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_USER_MATRIX .
"_" . self::DEFAULT_ORG_UNIT_OPERATION .
"_"
567 . self::DEFAULT_CONTEXT
572 $q =
"CREATE TEMPORARY TABLE IF NOT EXISTS " . $temporary_table_name .
" AS (
573 SELECT DISTINCT user_perm_matrix.perm_for_ref_id, user_perm_matrix.usr_id FROM
575 SELECT crs.*," . $tmp_table_course_members .
".ref_id," . $tmp_table_course_members .
".usr_id FROM
577 SELECT * FROM " . $tmp_table_objects_specific_perimissions .
"
579 SELECT * FROM " . $tmp_table_objects_default_perimissions .
"
581 INNER JOIN " . $tmp_table_course_members .
" on " . $tmp_table_course_members .
".ref_id = crs.perm_for_ref_id
584 " . $tmp_table_course_members .
".orgu_id = crs.perm_for_orgu_id AND " . $tmp_table_course_members .
".position_id = crs.perm_over_user_with_position AND perm_orgu_scope = 1
586 or perm_orgu_scope = 2
589 SELECT " . $tmp_table_orgunit_default_perimissions .
".*, " . $tmp_table_orgu_members .
".orgu_id AS ref_id, "
590 . $tmp_table_orgu_members .
".user_id FROM " . $tmp_table_orgunit_default_perimissions .
"
591 INNER JOIN " . $tmp_table_orgu_members .
" on " . $tmp_table_orgu_members .
".orgu_id = "
592 . $tmp_table_orgunit_default_perimissions .
".perm_for_ref_id
595 " . $tmp_table_orgu_members .
".orgu_id = " . $tmp_table_orgunit_default_perimissions .
".perm_for_orgu_id AND "
596 . $tmp_table_orgu_members .
".user_position_id = " . $tmp_table_orgunit_default_perimissions .
".perm_over_user_with_position AND perm_orgu_scope = 1
598 or perm_orgu_scope = 2
601 ) AS user_perm_matrix
602 INNER JOIN " . $tmp_table_orgu_member_path .
" AS path on path.user_id = user_perm_matrix.usr_id
604 INNER JOIN il_orgu_ua AS orgu_ua_current_user on orgu_ua_current_user.user_id = " .
$DIC->database()->quote($user_id,
'integer') .
"
605 INNER JOIN il_orgu_permissions AS perm on perm.position_id = orgu_ua_current_user.position_id AND perm.parent_id = -1
606 INNER JOIN il_orgu_op_contexts AS contexts on contexts.id = perm.context_id AND contexts.context = '$context'
607 and perm.operations LIKE '%\"" . $operation->getOperationId() .
"\"%'
611 /* Identische OrgUnit wie Current User; Nicht Rekursiv; Fixe Position */
612 (orgu_ua_current_user.orgu_id = user_perm_matrix.perm_for_orgu_id AND user_perm_matrix.perm_orgu_scope = 1
613 AND orgu_ua_current_user.position_id = user_perm_matrix.perm_for_position_id AND user_perm_matrix.perm_over_user_with_position <> -1
616 /* Identische OrgUnit wie Current User; Nicht Rekursiv; Position egal */
617 (orgu_ua_current_user.orgu_id = user_perm_matrix.perm_for_orgu_id AND user_perm_matrix.perm_orgu_scope = 1 AND user_perm_matrix.perm_over_user_with_position = -1)
619 /* Kinder OrgUnit wie Current User */
621 orgu_ua_current_user.orgu_id = user_perm_matrix.perm_for_orgu_id
624 path.orgu_id = user_perm_matrix.perm_for_orgu_id OR
625 path.tree_path LIKE CONCAT(\"%.\",user_perm_matrix.perm_for_orgu_id ,\".%\")
627 path.tree_path LIKE CONCAT(\"%.\",user_perm_matrix.perm_for_orgu_id )
633 /* Gleiche Position */
634 orgu_ua_current_user.position_id = user_perm_matrix.perm_for_position_id AND user_perm_matrix.perm_over_user_with_position <> -1
639 user_perm_matrix.perm_over_user_with_position = -1
642 AND user_perm_matrix.perm_orgu_scope = 2
648 $DIC->database()->manipulate($q);
650 return $temporary_table_name;
661 public function buildTempTableIlobjectsSpecificPermissionSetForOperationAndContext(
662 $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION,
664 $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_SPEC_PERMISSIONS
668 $temporary_table_name = $temporary_table_name_prefix .
"_" . $org_unit_operation_string .
"_" .
$context;
675 if ($temporary_table_name != self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_SPEC_PERMISSIONS .
"_" . self::DEFAULT_ORG_UNIT_OPERATION .
"_"
676 . self::DEFAULT_CONTEXT
681 $q =
"CREATE TEMPORARY TABLE IF NOT EXISTS " . $temporary_table_name .
"
682 (INDEX i1 (perm_for_ref_id), INDEX i2 (perm_for_orgu_id), INDEX i3 (perm_orgu_scope), INDEX i4 (perm_for_position_id), INDEX i5 (perm_over_user_with_position))
685 obj_ref.ref_id AS perm_for_ref_id,
686 orgu_ua.orgu_id AS perm_for_orgu_id,
687 auth.scope AS perm_orgu_scope,
688 orgu_ua.position_id AS perm_for_position_id,
689 auth.over AS perm_over_user_with_position
691 il_orgu_permissions AS perm
692 INNER JOIN il_orgu_ua AS orgu_ua ON orgu_ua.position_id = perm.position_id
693 INNER JOIN il_orgu_authority AS auth ON auth.position_id = orgu_ua.position_id AND orgu_ua.user_id = " .
$GLOBALS[
'DIC']->user()
695 INNER JOIN object_reference AS obj_ref ON obj_ref.ref_id = perm.parent_id
696 INNER JOIN object_data AS obj ON obj.obj_id = obj_ref.obj_id AND obj.type = '$context'
697 INNER JOIN il_orgu_op_contexts AS contexts on contexts.id = perm.context_id AND contexts.context = '$context'
699 perm.operations LIKE '%\"" . $operation->getOperationId() .
"\"%'
702 $DIC->database()->manipulate($q);
704 return $temporary_table_name;
715 public function buildTempTableIlobjectsDefaultPermissionSetForOperationAndContext(
718 $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_DEFAULT_PERMISSIONS
722 $temporary_table_name = $temporary_table_name_prefix .
"_" . $org_unit_operation_string .
"_" .
$context;
729 if ($temporary_table_name != self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_DEFAULT_PERMISSIONS .
"_" . self::DEFAULT_ORG_UNIT_OPERATION .
"_"
730 . self::DEFAULT_CONTEXT
735 $q =
"CREATE TEMPORARY TABLE IF NOT EXISTS " . $temporary_table_name .
"
736 (INDEX i1 (perm_for_ref_id), INDEX i2 (perm_for_orgu_id), INDEX i3 (perm_orgu_scope), INDEX i4 (perm_for_position_id),INDEX i5 (perm_over_user_with_position))
739 obj_ref.ref_id AS perm_for_ref_id,
740 orgu_ua.orgu_id AS perm_for_orgu_id,
741 auth.scope AS perm_orgu_scope,
742 orgu_ua.position_id AS perm_for_position_id,
743 auth.over AS perm_over_user_with_position
746 INNER JOIN object_reference AS obj_ref ON obj_ref.obj_id = obj.obj_id
747 INNER JOIN il_orgu_permissions AS perm ON perm.operations LIKE '%\"" . $operation->getOperationId() .
"\"%' AND perm.parent_id = -1
748 INNER JOIN il_orgu_op_contexts AS contexts on contexts.id = perm.context_id AND contexts.context = '" .
$context .
"'
749 INNER JOIN il_orgu_ua AS orgu_ua ON orgu_ua.position_id = perm.position_id AND orgu_ua.user_id = " .
$GLOBALS[
'DIC']->user()
751 INNER JOIN il_orgu_authority AS auth ON auth.position_id = orgu_ua.position_id
755 AND (obj_ref.ref_id , orgu_ua.position_id)
758 perm.parent_id, orgu_ua.position_id
760 il_orgu_permissions AS perm
761 INNER JOIN il_orgu_ua AS orgu_ua ON orgu_ua.position_id = perm.position_id
762 INNER JOIN il_orgu_op_contexts AS contexts on contexts.id = perm.context_id AND contexts.context = '" .
$context .
"'
763 WHERE perm.parent_id <> -1)
766 $DIC->database()->manipulate($q);
768 return $temporary_table_name;
779 public function buildTempTableIlorgunitDefaultPermissionSetForOperationAndContext(
780 $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION,
782 $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_ORGU_DEFAULT_PERMISSIONS
786 $temporary_table_name = $temporary_table_name_prefix .
"_" . $org_unit_operation_string .
"_" .
$context;
792 if ($temporary_table_name != self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_ORGU_DEFAULT_PERMISSIONS .
"_" . self::DEFAULT_ORG_UNIT_OPERATION .
"_"
793 . self::DEFAULT_CONTEXT
798 $q =
"CREATE TEMPORARY TABLE IF NOT EXISTS " . $temporary_table_name .
"
799 (INDEX i1 (perm_for_ref_id), INDEX i2 (perm_for_orgu_id), INDEX i3 (perm_orgu_scope), INDEX i4 (perm_for_position_id), INDEX i5 (perm_over_user_with_position))
802 orgu_ua.orgu_id AS perm_for_ref_id, /* Table has to be identical to the other Permission For Operation And Context-Tables! */
803 orgu_ua.orgu_id AS perm_for_orgu_id,
804 auth.scope AS perm_orgu_scope,
805 orgu_ua.position_id AS perm_for_position_id,
806 auth.over AS perm_over_user_with_position
808 il_orgu_permissions AS perm
809 INNER JOIN il_orgu_ua AS orgu_ua ON orgu_ua.position_id = perm.position_id AND perm.parent_id = -1 AND orgu_ua.user_id = "
810 .
$GLOBALS[
'DIC']->user()->getId() .
"
811 INNER JOIN il_orgu_authority AS auth ON auth.position_id = orgu_ua.position_id
812 INNER JOIN il_orgu_op_contexts AS contexts on contexts.id = perm.context_id AND contexts.context = '" .
$context .
"'
814 perm.operations LIKE '%\"" . $operation->getOperationId() .
"\"%'
817 $DIC->database()->manipulate($q);
819 return $temporary_table_name;
829 public function buildTempTableCourseMemberships($temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_CRS_MEMBERS, array $only_courses_of_user_ids = array())
833 $temporary_table_name = $temporary_table_name_prefix .
"_user_id_" .
$DIC->user()->getId();
835 if ($temporary_table_name != self::TMP_DEFAULT_TABLE_NAME_PREFIX_CRS_MEMBERS .
"_user_id_" .
$DIC->user()->getId()
836 || count($only_courses_of_user_ids) > 0
841 $q =
"CREATE TEMPORARY TABLE IF NOT EXISTS " . $temporary_table_name .
"
842 (INDEX i1(ref_id), INDEX i2 (usr_id), INDEX i3 (position_id), INDEX i4 (orgu_id))
844 SELECT crs_members_crs_ref.ref_id, crs_members.usr_id, orgu_ua.position_id, orgu_ua.orgu_id
846 SELECT obj_id, usr_id FROM obj_members WHERE member = 1
847 AND " .
$DIC->database()->in(
'obj_members.usr_id', $only_courses_of_user_ids,
false,
'integer') .
"
849 SELECT obj_id, usr_id FROM crs_waiting_list
850 WHERE " .
$DIC->database()->in(
'crs_waiting_list.usr_id', $only_courses_of_user_ids,
false,
'integer') .
"
852 SELECT obj_id, usr_id FROM il_subscribers
853 WHERE " .
$DIC->database()->in(
'il_subscribers.usr_id', $only_courses_of_user_ids,
false,
'integer') .
"
855 INNER JOIN object_reference AS crs_members_crs_ref on crs_members_crs_ref.obj_id = crs_members.obj_id
856 INNER JOIN il_orgu_ua AS orgu_ua on orgu_ua.user_id = crs_members.usr_id
859 $DIC->database()->manipulate($q);
861 return $temporary_table_name;
871 public function buildTempTableOrguMemberships($temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_ORGU_MEMBERS, array $only_orgus_of_user_ids = array())
875 $temporary_table_name = $temporary_table_name_prefix .
"_user_id_" .
$DIC->user()->getId();
877 if ($temporary_table_name != self::TMP_DEFAULT_TABLE_NAME_PREFIX_ORGU_MEMBERS .
"_user_id_" .
$DIC->user()->getId()
878 || count($only_orgus_of_user_ids) > 0
883 $q =
"CREATE TEMPORARY TABLE IF NOT EXISTS " . $temporary_table_name .
"
884 (INDEX i1(orgu_id), INDEX i2 (tree_path), INDEX i3 (tree_child), INDEX i4 (tree_parent), INDEX i5 (tree_lft), INDEX i6 (tree_rgt), INDEX i7 (user_position_id), INDEX i8 (user_id))
886 SELECT orgu_ua.orgu_id AS orgu_id,
887 tree_orgu.path AS tree_path,
888 tree_orgu.child AS tree_child,
889 tree_orgu.parent AS tree_parent,
890 tree_orgu.lft AS tree_lft,
891 tree_orgu.rgt AS tree_rgt,
892 orgu_ua.position_id AS user_position_id,
893 orgu_ua.user_id AS user_id
895 il_orgu_ua AS orgu_ua
896 INNER JOIN object_reference AS obj_ref on obj_ref.ref_id = orgu_ua.orgu_id AND obj_ref.deleted is null
897 LEFT JOIN tree AS tree_orgu ON tree_orgu.child = orgu_ua.orgu_id";
899 if (count($only_orgus_of_user_ids) > 0) {
900 $q .=
" WHERE " .
$DIC->database()->in(
'orgu_ua.user_id', $only_orgus_of_user_ids,
false,
'integer') .
" ";
905 $DIC->database()->manipulate($q);
907 return $temporary_table_name;
920 $q =
"DROP TABLE IF EXISTS " . $temporary_table_name;
921 $DIC->database()->manipulate($q);
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
buildTempTableCourseMemberships($temporary_table_name_prefix=self::TMP_DEFAULT_TABLE_NAME_PREFIX_CRS_MEMBERS, array $only_courses_of_user_ids=array())
const TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_SPEC_PERMISSIONS
getIdsForPositionAndOperationAndContext(int $position_id, string $operation, string $context, bool $return_ref_id)
returns all obj_ids/ref_ids (depending on flag "ref_id") of objects of type $context,...
dropTempTable($temporary_table_name)
hasCurrentUserAccessToCourseLearningProgressForAtLeastOneUser()
getUsersForUserPerPosition($user_id)
hasCurrentUserAccessToCompetences()
hasPositionDefaultPermissionForOperationInContext(int $position_id, int $operation_id, int $context_id)
const TMP_DEFAULT_TABLE_NAME_PREFIX_ORGU_MEMBERS
getUsersForUserOperationAndContext( $user_id, $org_unit_operation_string=self::DEFAULT_ORG_UNIT_OPERATION, $context=self::DEFAULT_CONTEXT, $tmp_table_name_prefix=self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_USER_MATRIX)
const TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_USER_MATRIX
hasCurrentUserAccessToMyStaff()
static $orgu_users_of_current_user_show_staff_permission
hasCurrentUserAccessToUser($usr_id=0)
getIdsForPositionAndOperation(int $position_id, string $operation, bool $return_ref_id)
const TMP_DEFAULT_TABLE_NAME_PREFIX_IL_ORGU_DEFAULT_PERMISSIONS
buildTempTableOrguMemberships($temporary_table_name_prefix=self::TMP_DEFAULT_TABLE_NAME_PREFIX_ORGU_MEMBERS, array $only_orgus_of_user_ids=array())
const DEFAULT_ORG_UNIT_OPERATION
hasCurrentUserAccessToLearningProgressInObject($ref_id=0)
const TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_DEFAULT_PERMISSIONS
getUsersForUser($user_id, ?int $position_id=null)
const TMP_DEFAULT_TABLE_NAME_PREFIX_CRS_MEMBERS
getIdsForUserAndOperation(int $user_id, string $operation, bool $return_ref_id=false)
hasCurrentUserAccessToCertificates()
countOrgusOfUserWithAtLeastOneOperation($user_id)
Class ilOrgUnitOperationContextQueries.
static findByName($context_name)
Class ilOrgUnitOperationContext.
static $available_contexts
Class ilOrgUnitOperationQueries.
static findByOperationString($operation_string, $context_name)
Class ilOrgUnitOperation.
const OP_VIEW_CERTIFICATES
const OP_VIEW_COMPETENCES
const OP_ACCESS_ENROLMENTS
const OP_READ_LEARNING_PROGRESS
Class ilOrgUnitUserAssignmentQueries.
foreach($_POST as $key=> $value) $res