ILIAS  release_4-4 Revision
ilObjRemoteLearningModuleAccess Class Reference
+ Inheritance diagram for ilObjRemoteLearningModuleAccess:
+ Collaboration diagram for ilObjRemoteLearningModuleAccess:

Public Member Functions

 _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...
 
 _getCommands ()
 get commands 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=0)
 check condition More...
 
 _getCommands ()
 get commands More...
 
 _checkGoto ($a_target)
 check whether goto script will succeed More...
 
 _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectAccess
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten. More...
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 36 of file class.ilObjRemoteLearningModuleAccess.php.

Member Function Documentation

◆ _checkAccess()

ilObjRemoteLearningModuleAccess::_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)

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

Definition at line 50 of file class.ilObjRemoteLearningModuleAccess.php.

References $ilUser, $lng, ilObjRemoteLearningModule\_lookupOnline(), and IL_NO_OBJECT_ACCESS.

51  {
52  global $ilUser, $lng, $rbacsystem, $ilAccess, $ilias;
53 
54  if ($a_user_id == "")
55  {
56  $a_user_id = $ilUser->getId();
57  }
58 
59  switch ($a_permission)
60  {
61  case "visible":
62  include_once './Modules/RemoteLearningModule/classes/class.ilObjRemoteLearningModule.php';
63  $active = ilObjRemoteLearningModule::_lookupOnline($a_obj_id);
64  $tutor = $rbacsystem->checkAccessOfUser($a_user_id,'write',$a_ref_id);
65 
66  if(!$active)
67  {
68  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
69  }
70  if(!$tutor and !$active)
71  {
72  return false;
73  }
74  break;
75 
76  case 'read':
77  $tutor = $rbacsystem->checkAccessOfUser($a_user_id,'write',$a_ref_id);
78  if($tutor)
79  {
80  return true;
81  }
82  include_once 'Modules/RemoteLearningModule/classes/class.ilObjRemoteLearningModule.php';
83  $active = ilObjRemoteLearningModule::_lookupOnline($a_obj_id);
84 
85  if(!$active)
86  {
87  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
88  return false;
89  }
90  break;
91  }
92  return true;
93  }
static _lookupOnline($a_obj_id)
Lookup online.
const IL_NO_OBJECT_ACCESS
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ _getCommands()

ilObjRemoteLearningModuleAccess::_getCommands ( )

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"), );

Definition at line 107 of file class.ilObjRemoteLearningModuleAccess.php.

Referenced by ilObjRemoteLearningModuleListGUI\init().

108  {
109  $commands = array
110  (
111  array("permission" => "read", "cmd" => "show", "lang_var" => "info",
112  "default" => true),
113  array("permission" => "write", "cmd" => "edit", "lang_var" => "edit")
114  );
115 
116  return $commands;
117  }
+ Here is the caller graph for this function:

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