ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilExerciseMembersFilter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilExerciseMembersFilter:

Public Member Functions

 __construct (int $a_exc_ref_id, array $a_participants_ids, int $a_user_id)
 
 filterParticipantsByAccess ()
 Filter manageable members by position or rbac access. More...
 

Protected Attributes

array $members
 
ilAccessHandler $access
 
int $exercise_ref_id
 
int $user_id
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilExerciseMembersFilter

Author
Jesús López lopez.nosp@m.@lei.nosp@m.fos.d.nosp@m.e
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 25 of file class.ilExerciseMembersFilter.php.

Constructor & Destructor Documentation

◆ __construct()

ilExerciseMembersFilter::__construct ( int  $a_exc_ref_id,
array  $a_participants_ids,
int  $a_user_id 
)
Parameters
int$a_exc_ref_id
array$a_participants_ids
int$a_user_id// id of the executioner, can come from CRON JOBS

Definition at line 37 of file class.ilExerciseMembersFilter.php.

41 {
42 global $DIC;
43
44 $this->access = $DIC->access();
45 if ($a_user_id) {
46 $this->user_id = $a_user_id;
47 } else {
48 $this->user_id = $DIC->user()->getId();
49 }
50
51 $this->exercise_ref_id = $a_exc_ref_id;
52 $this->members = $a_participants_ids;
53 }
global $DIC
Definition: shib_login.php:26

References $DIC, and ILIAS\Repository\access().

+ Here is the call graph for this function:

Member Function Documentation

◆ filterParticipantsByAccess()

ilExerciseMembersFilter::filterParticipantsByAccess ( )

Filter manageable members by position or rbac access.

Returns
int[]

Definition at line 59 of file class.ilExerciseMembersFilter.php.

59 : array
60 {
61 if ($this->access->checkAccessOfUser(
62 $this->user_id,
63 'edit_submissions_grades',
64 '',
65 $this->exercise_ref_id
66 )) {
67 // if access by rbac granted => return all
68 return $this->members;
69 }
70 return $this->access->filterUserIdsByPositionOfUser(
71 $this->user_id,
72 'edit_submissions_grades',
73 $this->exercise_ref_id,
74 $this->members
75 );
76 }

References $members, and ILIAS\Repository\access().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilExerciseMembersFilter::$access
protected

Definition at line 28 of file class.ilExerciseMembersFilter.php.

◆ $exercise_ref_id

int ilExerciseMembersFilter::$exercise_ref_id
protected

Definition at line 29 of file class.ilExerciseMembersFilter.php.

◆ $members

array ilExerciseMembersFilter::$members
protected

Definition at line 27 of file class.ilExerciseMembersFilter.php.

Referenced by filterParticipantsByAccess().

◆ $user_id

int ilExerciseMembersFilter::$user_id
protected

Definition at line 30 of file class.ilExerciseMembersFilter.php.


The documentation for this class was generated from the following file: