36 $this->
user = $DIC->user();
37 $this->
lng = $DIC->language();
38 $this->rbacsystem =
$DIC->rbac()->system();
39 $this->
access = $DIC->access();
50 public static function checkCondition(
int $a_trigger_obj_id,
string $a_operator,
string $a_value,
int $a_usr_id): bool
52 switch ($a_operator) {
54 if (self::_lookupFinished($a_trigger_obj_id, $a_usr_id)) {
66 public function _checkAccess(
string $cmd,
string $permission,
int $ref_id,
int $obj_id, ?
int $user_id =
null): bool
73 if (is_null($user_id)) {
79 switch ($permission) {
82 if (!self::_lookupCreationComplete($obj_id) &&
92 if (!self::_lookupCreationComplete($obj_id)) {
99 if (!self::_lookupCreationComplete($obj_id)) {
118 array(
"permission" =>
"read",
"cmd" =>
"infoScreen",
"lang_var" =>
"svy_run",
"default" =>
true),
119 array(
"permission" =>
"write",
"cmd" =>
"questions",
"lang_var" =>
"edit_questions"),
120 array(
"permission" =>
"write",
"cmd" =>
"properties",
"lang_var" =>
"settings"),
121 array(
"permission" =>
"read",
"cmd" =>
"evaluation",
"lang_var" =>
"svy_results")
140 $result =
$ilDB->queryF(
141 "SELECT * FROM svy_svy WHERE obj_fi=%s",
147 if ($result->numRows() === 1) {
148 $row =
$ilDB->fetchAssoc($result);
150 if (is_null($row) || !$row[
"complete"]) {
165 $result =
$ilDB->queryF(
166 "SELECT * FROM svy_svy WHERE obj_fi=%s",
170 if ($result->numRows() === 1) {
171 $row =
$ilDB->fetchAssoc($result);
172 return (
int) $row[
"evaluation_access"];
185 $result =
$ilDB->queryF(
186 "SELECT finished_id FROM svy_finished WHERE user_fi = %s AND survey_fi = %s",
187 array(
'integer',
'integer'),
188 array($user_id, $survey_id)
190 return $result->numRows() === 1;
200 $result =
$ilDB->queryF(
201 "SELECT anonymize FROM svy_svy WHERE obj_fi = %s",
205 if ($result->numRows() === 1) {
206 $row =
$ilDB->fetchAssoc($result);
207 return (
bool) $row[
"anonymize"];
217 $evaluation_access = self::_lookupEvaluationAccess($a_obj_id);
218 $svy_mode = self::_lookupMode($a_obj_id);
223 switch ($svy->get360Results()) {
235 switch ($evaluation_access) {
247 switch ($svy->get360Results()) {
252 return $svy->isAppraiseeClosed($user_id);
255 return $svy->isAppraisee($user_id);
262 switch ($svy->get360Results()) {
270 return $svy->isAppraisee($user_id);
277 switch ($svy->getSelfEvaluationResults()) {
291 if (self::_lookupAnonymize($a_obj_id)) {
298 $result =
$ilDB->queryF(
299 "SELECT survey_id FROM svy_svy WHERE obj_fi = %s",
303 if ($result->numRows() === 1) {
304 $row =
$ilDB->fetchAssoc($result);
306 if (self::_isSurveyParticipant($user_id, $row[
"survey_id"])) {
332 if ($a_user_id === 0) {
336 $result =
$ilDB->queryF(
337 "SELECT * FROM svy_svy WHERE obj_fi = %s",
341 if ($result->numRows() === 1) {
342 $row =
$ilDB->fetchObject($result);
343 if ((
int) $row->anonymize === 1) {
344 $result =
$ilDB->queryF(
345 "SELECT * FROM svy_finished, svy_anonymous WHERE svy_finished.survey_fi = %s " .
346 "AND svy_finished.survey_fi = svy_anonymous.survey_fi AND svy_anonymous.user_key = %s " .
347 "AND svy_anonymous.survey_key = svy_finished.anonymous_id",
348 array(
'integer',
'text'),
349 array($row->survey_id, md5($a_user_id))
352 $result =
$ilDB->queryF(
353 "SELECT * FROM svy_finished WHERE survey_fi = %s AND user_fi = %s",
354 array(
'integer',
'integer'),
355 array($row->survey_id, $a_user_id)
358 if ($result->numRows() === 1) {
359 $foundrow =
$ilDB->fetchAssoc($result);
360 $finished = (
int) $foundrow[
"state"];
376 $result =
$ilDB->queryF(
377 "SELECT mode FROM svy_svy" .
378 " WHERE obj_fi = %s",
383 if ($result->numRows() === 1) {
384 $row =
$ilDB->fetchAssoc($result);
385 return (
int) $row[
"mode"];
398 $result =
$ilDB->queryF(
399 "SELECT mode FROM svy_svy" .
400 " WHERE obj_fi = %s AND mode = %s",
401 array(
'integer',
'integer'),
404 return (
bool)
$ilDB->numRows($result);
414 $request =
$DIC->survey()
420 $ilAccess =
$DIC->access();
422 $t_arr = explode(
"_", $target);
423 if ($t_arr[0] !==
"svy" || ((
int) $t_arr[1]) <= 0) {
428 $access_code = ($request->getAccessCode() !==
"")
429 ? $request->getAccessCode()
431 if ($access_code !==
"") {
433 $run_manager =
$DIC->survey()->internal()->domain()->execution()->run($survey,
$DIC->user()->getId());
435 $run_manager->initSession($access_code);
436 }
catch (Exception
$e) {
439 if (ilObjSurvey::validateExternalRaterCode((
int) $t_arr[1], $access_code)) {
444 if ($ilAccess->checkAccess(
"visible",
"", $t_arr[1]) ||
445 $ilAccess->checkAccess(
"read",
"", $t_arr[1])) {
const IL_NO_OBJECT_ACCESS
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
_checkAccess(string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAcc...
static _lookupAnonymize(int $a_obj_id)
static _checkGoto(string $target)
check whether goto script will succeed
static _lookupMode(int $a_obj_id)
Get survey mode (see ilObjSurvey::MODE_... constants)
static _lookupFinished(int $a_obj_id, int $a_user_id=0)
get finished status
static _lookup360Mode(int $a_obj_id)
static getConditionOperators()
Returns an array with valid operators for the specific object type.
static _getCommands()
get commands
static _lookupEvaluationAccess(int $a_obj_id)
get evaluation access
static _isSurveyParticipant(int $user_id, int $survey_id)
static _lookupCreationComplete(int $a_obj_id)
checks whether all necessary parts of the survey are given
static _hasEvaluationAccess(int $a_obj_id, int $user_id)
static checkCondition(int $a_trigger_obj_id, string $a_operator, string $a_value, int $a_usr_id)
check condition for a specific user and object
const RESULTS_SELF_EVAL_NONE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
checkAccessOfUser(int $a_user_id, string $a_operations, int $a_ref_id, string $a_type="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface for condition handling.