ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjRemoteWikiAccess Class Reference
+ Inheritance diagram for ilObjRemoteWikiAccess:
+ Collaboration diagram for ilObjRemoteWikiAccess:

Public Member Functions

 _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 ()
 get commands More...
 
- 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...
 

Detailed Description

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

\

Definition at line 31 of file class.ilObjRemoteWikiAccess.php.

Member Function Documentation

◆ _checkAccess()

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

Reimplemented from ilObjectAccess.

Definition at line 37 of file class.ilObjRemoteWikiAccess.php.

37 : bool
38 {
39 global $ilUser, $lng, $rbacsystem, $ilAccess;
40
41 if (is_null($user_id)) {
42 $user_id = $ilUser->getId();
43 }
44
45 switch ($permission) {
46 case "visible":
47 $active = ilObjRemoteWiki::_lookupOnline($obj_id);
48 $tutor = $rbacsystem->checkAccessOfUser($user_id, 'write', $ref_id);
49
50 if (!$active) {
51 $ilAccess->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
52 }
53 if (!$tutor and !$active) {
54 return false;
55 }
56 break;
57
58 case 'read':
59 $tutor = $rbacsystem->checkAccessOfUser($user_id, 'write', $ref_id);
60 if ($tutor) {
61 return true;
62 }
63 $active = ilObjRemoteWiki::_lookupOnline($obj_id);
64
65 if (!$active) {
66 $ilAccess->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
67 return false;
68 }
69 break;
70 }
71 return true;
72 }
static _lookupOnline($a_obj_id)
Lookup online.
$ref_id
Definition: ltiauth.php:66
global $lng
Definition: privfeed.php:31

References $lng, $ref_id, $user_id, ilObjRemoteWiki\_lookupOnline(), and ilAccessInfo\IL_NO_OBJECT_ACCESS.

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

Reimplemented from ilObjectAccess.

Definition at line 86 of file class.ilObjRemoteWikiAccess.php.

86 : array
87 {
88 $commands = array(
89 array("permission" => "read", "cmd" => "show", "lang_var" => "info",
90 "default" => true),
91 array("permission" => "write", "cmd" => "edit", "lang_var" => "edit")
92 );
93
94 return $commands;
95 }

Referenced by ilObjRemoteWikiListGUI\init().

+ Here is the caller graph for this function:

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