3declare(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) ||
129 $this->checkRbacOrPositionPermission(
'read_results',
'access_results') ||
137 string $a_rbac_permission,
138 string $a_position_permission
143 $a_position_permission,
153 $survey = $this->getSurvey();
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(
182 $this->getSurvey()->getRefId(),
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;
canStartSurvey()
Can start the survey This is possible for external raters, or users with read or visible permission N...
canAccessInfoScreen()
Can access info screen: This is possible for external raters, or users with read or visible permissio...
canReadResultOfParticipants(?array $a_finished_ids=null)
Gets all participants or a subset of participants (by run ids) where the current user can access the ...
canAccessEvaluation()
Can access evaluation.
InternalDomainService $domain_service
checkRbacOrPositionPermission(string $a_rbac_permission, string $a_position_permission)
isCodeInputAllowed()
Is it possible to take the survey by providing an access code?
__construct(InternalDomainService $domain_service, \ilAccessHandler $access, int $ref_id, int $user_id)
Survey internal domain service.
static _hasEvaluationAccess(int $a_obj_id, int $user_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkRbacOrPositionPermissionAccess(string $rbac_perm, string $pos_perm, int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...