ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjLearningSequenceAccess Class Reference

Class ilObjLearningSequenceAccess class. More...

+ Inheritance diagram for ilObjLearningSequenceAccess:
+ Collaboration diagram for ilObjLearningSequenceAccess:

Public Member Functions

 usingRegistrationCode ()
 
 _checkAccess ($cmd, $permission, $ref_id, $obj_id, $usr_id="")
 
- Public Member Functions inherited from ilObjectAccess
 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id)
 check condition More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
Parameters
ilWACPath$ilWACPath
Returns
bool
More...
 

Static Public Member Functions

static _getCommands ()
 
static isOffline ($ref_id)
 
- Static Public Member Functions inherited from ilObjectAccess
static _getCommands ()
 get commands More...
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling. More...
 
static _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Static Public Attributes

static $using_code = false
 

Protected Member Functions

 getDICDependencies ()
 

Detailed Description

Class ilObjLearningSequenceAccess class.

Definition at line 11 of file class.ilObjLearningSequenceAccess.php.

Member Function Documentation

◆ _checkAccess()

ilObjLearningSequenceAccess::_checkAccess (   $cmd,
  $permission,
  $ref_id,
  $obj_id,
  $usr_id = "" 
)

Definition at line 93 of file class.ilObjLearningSequenceAccess.php.

References $lng, getDICDependencies(), IL_NO_OBJECT_ACCESS, and isOffline().

94  {
95  list($rbacsystem, $il_access, $lng) = $this->getDICDependencies();
96 
97  switch ($permission) {
98  case 'visible':
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)
103  );
104 
105  $is_offine = $this->isOffline($ref_id);
106 
107  if ($is_offine && !$has_any_administrative_permission) {
108  $il_access->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
109  return false;
110  }
111  return true;
112 
113  default:
114  return $rbacsystem->checkAccessOfUser($usr_id, $permission, $ref_id);
115  }
116  }
const IL_NO_OBJECT_ACCESS
$lng
+ Here is the call graph for this function:

◆ _getCommands()

static ilObjLearningSequenceAccess::_getCommands ( )
static

Definition at line 15 of file class.ilObjLearningSequenceAccess.php.

References ilObjLearningSequenceGUI\CMD_CONTENT, ilObjLearningSequenceGUI\CMD_LEARNER_VIEW, ilObjLearningSequenceGUI\CMD_SETTINGS, ilObjLearningSequenceGUI\CMD_UNPARTICIPATE, and ilObjLearningSequenceGUI\CMD_VIEW.

Referenced by ilObjLearningSequenceListGUI\init().

15  : array
16  {
17  $commands = array(
18  [
20  'permission' => 'read',
21  'lang_var' => 'show',
22  'default' => true
23  ],
24  [
26  'permission' => 'read',
27  'lang_var' => 'show',
28  ],
29  [
31  'permission' => 'write',
32  'lang_var' => 'edit_content'
33  ],
34  [
36  'permission' => 'write',
37  'lang_var' => 'settings'
38  ],
39  [
41  'permission' => 'unparticipate',
42  'lang_var' => 'unparticipate'
43  ]
44  );
45  return $commands;
46  }
+ Here is the caller graph for this function:

◆ getDICDependencies()

ilObjLearningSequenceAccess::getDICDependencies ( )
protected

Definition at line 118 of file class.ilObjLearningSequenceAccess.php.

References $DIC, and $lng.

Referenced by _checkAccess().

118  : array
119  {
120  global $DIC;
121  $rbacsystem = $DIC['rbacsystem'];
122  $il_access = $DIC['ilAccess'];
123  $lng = $DIC['lng'];
124 
125  return [
126  $rbacsystem,
127  $il_access,
128  $lng
129  ];
130  }
global $DIC
Definition: saml.php:7
$lng
+ Here is the caller graph for this function:

◆ isOffline()

static ilObjLearningSequenceAccess::isOffline (   $ref_id)
static

Definition at line 53 of file class.ilObjLearningSequenceAccess.php.

References ilObjectFactory\getInstanceByRefId().

Referenced by _checkAccess(), and ilObjLearningSequenceListGUI\getProperties().

54  {
56  $act = $obj->getLSActivation();
57  $online = $act->getIsOnline();
58 
59  if (!$online
60  && ($act->getActivationStart() !== null ||
61  $act->getActivationEnd() !== null)
62  ) {
63  $ts_now = time();
64  $activation_start = $act->getActivationStart();
65  if ($activation_start !== null) {
66  $after_activation_start = $ts_now >= $activation_start->getTimestamp();
67  } else {
68  $after_activation_start = true;
69  }
70  $activation_end = $act->getActivationEnd();
71  if ($activation_end !== null) {
72  $before_activation_end = $ts_now <= $activation_end->getTimestamp();
73  } else {
74  $before_activation_end = true;
75  }
76 
77  $online = ($after_activation_start && $before_activation_end);
78  }
79 
80  if ($act->getEffectiveOnlineStatus() === false && $online === true) {
81  $obj->setEffectiveOnlineStatus(true);
82  $obj->announceLSOOnline();
83  }
84  if ($act->getEffectiveOnlineStatus() === true && $online === false) {
85  $obj->setEffectiveOnlineStatus(false);
86  $obj->announceLSOOffline();
87  }
88 
89 
90  return !$online;
91  }
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ usingRegistrationCode()

ilObjLearningSequenceAccess::usingRegistrationCode ( )

Definition at line 48 of file class.ilObjLearningSequenceAccess.php.

49  {
50  return self::$using_code;
51  }

Field Documentation

◆ $using_code

ilObjLearningSequenceAccess::$using_code = false
static

Definition at line 13 of file class.ilObjLearningSequenceAccess.php.


The documentation for this class was generated from the following file: