ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjRemoteCourseAccess Class Reference
+ Inheritance diagram for ilObjRemoteCourseAccess:
+ Collaboration diagram for ilObjRemoteCourseAccess:

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...
 
- 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...
 

Static Public Member Functions

static _getCommands ()
 get commands More...
 
- 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. More...
 
static _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. 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.ilObjRemoteCourseAccess.php.

Member Function Documentation

◆ _checkAccess()

ilObjRemoteCourseAccess::_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.ilObjRemoteCourseAccess.php.

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

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

◆ _getCommands()

static ilObjRemoteCourseAccess::_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"), );

Definition at line 102 of file class.ilObjRemoteCourseAccess.php.

References array.

Referenced by ilObjRemoteCourseListGUI\init().

103  {
104  $commands = array(
105  array("permission" => "read", "cmd" => "show", "lang_var" => "info",
106  "default" => true),
107  array("permission" => "write", "cmd" => "edit", "lang_var" => "edit")
108  );
109 
110  return $commands;
111  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

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