19 declare(strict_types=1);
49 return new \ilObjSurvey($this->ref_id);
54 return $this->
access->checkAccessOfUser(
64 return $this->
access->checkAccessOfUser(
70 $this->
access->checkAccessOfUser(
84 $participant_status = $this->domain_service
86 ->status($this->
getSurvey(), $this->user_id);
87 if ($participant_status->isExternalRater() ||
88 $this->
access->checkAccessOfUser($this->user_id,
"read",
"", $this->ref_id) ||
89 $this->
access->checkAccessOfUser($this->user_id,
"visible",
"", $this->ref_id)) {
103 $participant_status = $this->domain_service
105 ->status($survey, $this->user_id);
106 if ($participant_status->isExternalRater() ||
107 $this->
access->checkAccessOfUser($this->user_id,
"read",
"", $this->ref_id)) {
108 if (!$survey->getOfflineStatus() &&
109 $survey->hasStarted() &&
110 !$survey->hasEnded()) {
119 return $this->
access->checkAccessOfUser($this->user_id,
"write",
"", $this->ref_id);
128 if ($this->
access->checkAccessOfUser($this->user_id,
"write",
"", $this->ref_id) ||
137 string $a_rbac_permission,
138 string $a_position_permission
143 $a_position_permission,
154 $participant_status = $this->domain_service
156 ->status($this->
getSurvey(), $this->user_id);
157 if ($participant_status->isExternalRater() ||
158 $survey->getAnonymize() || !$survey->isAccessibleWithoutCode()) {
169 ?array $a_finished_ids =
null 171 $all_participants = $this->
getSurvey()->getSurveyParticipants($a_finished_ids);
172 $participant_ids = [];
173 foreach ($all_participants as $participant) {
174 if (isset($participant[
'usr_id'])) {
175 $participant_ids[] = $participant[
'usr_id'];
179 $filtered_participant_ids = $this->
access->filterUserIdsByRbacOrPositionOfCurrentUser(
186 foreach ($all_participants as $username => $user_data) {
187 if (!isset($user_data[
'usr_id'])) {
188 $participants[$username] = $user_data;
190 if (in_array(($user_data[
'usr_id'] ??
null), $filtered_participant_ids)) {
191 $participants[$username] = $user_data;
194 return $participants;
InternalDomainService $domain_service
canAccessInfoScreen()
Can access info screen: This is possible for external raters, or users with read or visible permissio...
checkRbacOrPositionPermissionAccess(string $rbac_perm, string $pos_perm, int $ref_id)
canReadResultOfParticipants(?array $a_finished_ids=null)
Gets all participants or a subset of participants (by run ids) where the current user can access the ...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
canAccessEvaluation()
Can access evaluation.
canStartSurvey()
Can start the survey This is possible for external raters, or users with read or visible permission N...
static _hasEvaluationAccess(int $a_obj_id, int $user_id)
checkRbacOrPositionPermission(string $a_rbac_permission, string $a_position_permission)
__construct(InternalDomainService $domain_service, \ilAccessHandler $access, int $ref_id, int $user_id)
isCodeInputAllowed()
Is it possible to take the survey by providing an access code?