ILIAS  release_8 Revision v8.24
ilObjRemoteTestAccess Class Reference
+ Inheritance diagram for ilObjRemoteTestAccess:
+ Collaboration diagram for ilObjRemoteTestAccess:

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 30 of file class.ilObjRemoteTestAccess.php.

Member Function Documentation

◆ _checkAccess()

ilObjRemoteTestAccess::_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 36 of file class.ilObjRemoteTestAccess.php.

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

References $ilUser, $lng, $ref_id, ilObjRemoteTest\_lookupOnline(), and ilAccessInfo\IL_NO_OBJECT_ACCESS.

+ Here is the call graph for this function:

◆ _getCommands()

static ilObjRemoteTestAccess::_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.ilObjRemoteTestAccess.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 ilObjRemoteTestListGUI\init().

+ Here is the caller graph for this function:

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