3 declare(strict_types=1);
5 include_once(
"./Services/Object/classes/class.ilObjectAccess.php");
20 'permission' =>
'read',
26 'permission' =>
'read',
31 'permission' =>
'write',
32 'lang_var' =>
'edit_content' 36 'permission' =>
'write',
37 'lang_var' =>
'settings' 41 'permission' =>
'unparticipate',
42 'lang_var' =>
'unparticipate' 50 return self::$using_code;
56 $act = $obj->getLSActivation();
57 $online = $act->getIsOnline();
60 && ($act->getActivationStart() !== null ||
61 $act->getActivationEnd() !== null)
64 $activation_start = $act->getActivationStart();
65 if ($activation_start !== null) {
66 $after_activation_start = $ts_now >= $activation_start->getTimestamp();
68 $after_activation_start =
true;
70 $activation_end = $act->getActivationEnd();
71 if ($activation_end !== null) {
72 $before_activation_end = $ts_now <= $activation_end->getTimestamp();
74 $before_activation_end =
true;
77 $online = ($after_activation_start && $before_activation_end);
80 if ($act->getEffectiveOnlineStatus() ===
false && $online ===
true) {
81 $obj->setEffectiveOnlineStatus(
true);
82 $obj->announceLSOOnline();
84 if ($act->getEffectiveOnlineStatus() ===
true && $online ===
false) {
85 $obj->setEffectiveOnlineStatus(
false);
86 $obj->announceLSOOffline();
93 public function _checkAccess($cmd, $permission, $ref_id, $obj_id, $usr_id =
"")
97 switch ($permission) {
99 $has_any_administrative_permission = (
100 $rbacsystem->checkAccessOfUser($usr_id,
'write', $ref_id) ||
101 $rbacsystem->checkAccessOfUser($usr_id,
'edit_members', $ref_id) ||
102 $rbacsystem->checkAccessOfUser($usr_id,
'edit_learning_progress', $ref_id)
107 if ($is_offine && !$has_any_administrative_permission) {
114 return $rbacsystem->checkAccessOfUser($usr_id, $permission, $ref_id);
121 $rbacsystem = $DIC[
'rbacsystem'];
122 $il_access = $DIC[
'ilAccess'];
const IL_NO_OBJECT_ACCESS
static isOffline($ref_id)
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
_checkAccess($cmd, $permission, $ref_id, $obj_id, $usr_id="")
Class ilObjLearningSequenceAccess class.