ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjRemoteGlossaryAccess Class Reference
+ Inheritance diagram for ilObjRemoteGlossaryAccess:
+ Collaboration diagram for ilObjRemoteGlossaryAccess:

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)
 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.ilObjRemoteGlossaryAccess.php.

Member Function Documentation

◆ _checkAccess()

ilObjRemoteGlossaryAccess::_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

Reimplemented from ilObjectAccess.

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

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/RemoteGlossary/classes/class.ilObjRemoteGlossary.php';
63 $active = ilObjRemoteGlossary::_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/RemoteGlossary/classes/class.ilObjRemoteGlossary.php';
83 $active = ilObjRemoteGlossary::_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 }
const IL_NO_OBJECT_ACCESS
static _lookupOnline($a_obj_id)
Lookup online.
global $lng
Definition: privfeed.php:40
global $ilUser
Definition: imgupload.php:15

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

+ Here is the call graph for this function:

◆ _getCommands()

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

Reimplemented from ilObjectAccess.

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

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 }

Referenced by ilObjRemoteGlossaryListGUI\init().

+ Here is the caller graph for this function:

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