ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjRemoteWikiAccess Class Reference
+ Inheritance diagram for ilObjRemoteWikiAccess:
+ Collaboration diagram for ilObjRemoteWikiAccess:

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...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
Parameters
ilWACPath$ilWACPath
Returns
bool
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 if object type does not support centralized offline handling. 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.ilObjRemoteWikiAccess.php.

Member Function Documentation

◆ _checkAccess()

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

References $ilUser, $lng, ilObjRemoteWiki\_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/RemoteWiki/classes/class.ilObjRemoteWiki.php';
61  $active = ilObjRemoteWiki::_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/RemoteWiki/classes/class.ilObjRemoteWiki.php';
78  $active = ilObjRemoteWiki::_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
$lng
static _lookupOnline($a_obj_id)
Lookup online.
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ _getCommands()

static ilObjRemoteWikiAccess::_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 101 of file class.ilObjRemoteWikiAccess.php.

Referenced by ilObjRemoteWikiListGUI\init().

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

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