3 declare(strict_types=1);
30 public function _checkAccess(
string $cmd,
string $permission,
int $ref_id,
int $obj_id, ?
int $user_id = null): bool
32 if ($user_id === 0 || $user_id === null) {
34 $user_id = $DIC->user()->getId();
37 if ($permission ===
"delete") {
39 if ($prg->hasRelevantProgresses()) {
44 return parent::_checkAccess($cmd, $permission, $ref_id, $obj_id, $user_id);
62 $commands[] = [
'permission' =>
'read',
'cmd' =>
'view',
'lang_var' =>
'show',
'default' =>
true];
63 $commands[] = [
'permission' =>
'write',
'cmd' =>
'view',
'lang_var' =>
'edit_content'];
64 $commands[] = [
'permission' =>
'write',
'cmd' =>
'edit',
'lang_var' =>
'settings'];
75 $ilAccess = $DIC->access();
76 $t_arr = explode(
'_', $target);
77 if ($t_arr[0] !==
'prg' || ((
int) $t_arr[1]) <= 0) {
81 return $ilAccess->checkAccess(
'read',
'', (
int) $t_arr[1]);
102 int $a_trigger_obj_id,
109 $assignments = $repo->getAllForNodeIsContained($a_trigger_obj_id, [$a_usr_id]);
111 foreach ($assignments as $ass) {
112 if ($ass->getProgressForNode($a_trigger_obj_id)->isSuccessful()) {
static _getCommands()
get commands
static _checkGoto(string $target)
check whether goto script will succeed
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceByRefId($ref_id)
Interface for condition handling.
static checkCondition(int $a_trigger_obj_id, string $a_operator, string $a_value, int $a_usr_id)
const OPERATOR_ACCREDITED_OR_PASSED
static getConditionOperators()
Get operators.
_checkAccess(string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)