ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
ilObjLearningSequenceAccess Class Reference
+ Inheritance diagram for ilObjLearningSequenceAccess:
+ Collaboration diagram for ilObjLearningSequenceAccess:

Public Member Functions

 usingRegistrationCode ()
 
 _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::checkAccess) More...
 
- Public Member Functions inherited from ilObjectAccess
 _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::checkAccess) More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Public Member Functions

static _getCommands ()
 
- Static Public Member Functions inherited from ilObjectAccess
static _getCommands ()
 get commands More...
 
static _checkGoto (string $target)
 check whether goto script will succeed More...
 
static _isOffline (int $obj_id)
 Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling. More...
 
static _preloadData (array $obj_ids, array $ref_ids)
 Preload data. More...
 

Static Public Attributes

static bool $using_code = false
 

Protected Member Functions

 getDICDependencies ()
 

Detailed Description

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

Member Function Documentation

◆ _checkAccess()

ilObjLearningSequenceAccess::_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::checkAccess)

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

Reimplemented from ilObjectAccess.

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

65 : bool
66 {
67 list($rbacsystem, $il_access, $lng) = $this->getDICDependencies();
68
69 switch ($permission) {
70 case 'visible':
71 $has_any_administrative_permission = false;
72 if (!is_null($user_id)) {
73 $has_any_administrative_permission = (
74 $rbacsystem->checkAccessOfUser($user_id, 'write', $ref_id) ||
75 $rbacsystem->checkAccessOfUser($user_id, 'edit_members', $ref_id) ||
76 $rbacsystem->checkAccessOfUser($user_id, 'edit_learning_progress', $ref_id)
77 );
78 }
79
80 if ($this->_isOffline($ref_id)
81 && !$has_any_administrative_permission
82 ) {
83 $il_access->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
84 return false;
85 }
86 return true;
87
88 default:
89 if (is_null($user_id)) {
90 return false;
91 }
92 return $rbacsystem->checkAccessOfUser($user_id, $permission, $ref_id);
93 }
94 }
static _isOffline(int $obj_id)
Type-specific implementation of general status, has to be overwritten if object type does not support...
$ref_id
Definition: ltiauth.php:66
global $lng
Definition: privfeed.php:26

References $lng, $ref_id, $user_id, ilObjectAccess\_isOffline(), getDICDependencies(), and ilAccessInfo\IL_NO_OBJECT_ACCESS.

+ Here is the call graph for this function:

◆ _getCommands()

static ilObjLearningSequenceAccess::_getCommands ( )
static
Returns
array<array<string|bool>>

Reimplemented from ilObjectAccess.

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

28 : array
29 {
30 return array(
31 [
33 'permission' => 'read',
34 'lang_var' => 'show',
35 'default' => true
36 ],
37 [
39 'permission' => 'read',
40 'lang_var' => 'show',
41 ],
42 [
44 'permission' => 'write',
45 'lang_var' => 'edit_content'
46 ],
47 [
49 'permission' => 'write',
50 'lang_var' => 'settings'
51 ],
52 [
54 'permission' => 'unparticipate',
55 'lang_var' => 'unparticipate'
56 ]
57 );
58 }

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
Returns
array<ilRbacSystem|ilAccess|ilLanguage>

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

99 : array
100 {
101 global $DIC;
102 $rbacsystem = $DIC['rbacsystem'];
103 $il_access = $DIC['ilAccess'];
104 $lng = $DIC['lng'];
105
106 return [
107 $rbacsystem,
108 $il_access,
109 $lng
110 ];
111 }
global $DIC
Definition: shib_login.php:26

References $DIC, and $lng.

Referenced by _checkAccess().

+ Here is the caller graph for this function:

◆ usingRegistrationCode()

ilObjLearningSequenceAccess::usingRegistrationCode ( )

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

60 : bool
61 {
62 return self::$using_code;
63 }

References $using_code.

Field Documentation

◆ $using_code

bool ilObjLearningSequenceAccess::$using_code = false
static

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

Referenced by usingRegistrationCode().


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