ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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="")
 Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
- 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...
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Public Member Functions

static _getCommands ()
 get commands More...
 
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 (   $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)

Please do not check any preconditions handled by ilConditionHandler here. Also don't do any RBAC checks.

Parameters
string$a_cmdcommand (not permission!)
string$a_permissionpermission
int$a_ref_idreference id
int$a_obj_idobject id
int$a_user_iduser id (if not provided, current user is taken)
Returns
boolean true, if everything is ok

Reimplemented from ilObjectAccess.

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

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

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

+ Here is the call graph for this function:

◆ _getCommands()

static ilObjLearningSequenceAccess::_getCommands ( )
static

get commands

this method returns an array of all possible commands/permission combinations

example: $commands = array ( array("permission" => "read", "cmd" => "view", "lang_var" => "show"), array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"), );

Reimplemented from ilObjectAccess.

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

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 }

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

Referenced by ilObjLearningSequenceListGUI\init().

+ Here is the caller graph for this function:

◆ getDICDependencies()

ilObjLearningSequenceAccess::getDICDependencies ( )
protected

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

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 }
$DIC
Definition: xapitoken.php:46

References $DIC, and $lng.

Referenced by _checkAccess().

+ Here is the caller graph for this function:

◆ isOffline()

static ilObjLearningSequenceAccess::isOffline (   $ref_id)
static

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

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

References ilObjectFactory\getInstanceByRefId().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ usingRegistrationCode()

ilObjLearningSequenceAccess::usingRegistrationCode ( )

Field Documentation

◆ $using_code

ilObjLearningSequenceAccess::$using_code = false
static

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

Referenced by usingRegistrationCode().


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