ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjChatroomAccess Class Reference

Access class for chatroom objects. More...

+ Inheritance diagram for ilObjChatroomAccess:
+ Collaboration diagram for ilObjChatroomAccess:

Public Member Functions

 _getCommands ()
 This method returns an array of all possible commands/permission combinations. More...
 
 _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...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
Parameters
ilWACPath$ilWACPath
Returns
bool
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...
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Private Attributes

static $chat_enabled = null
 

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

Access class for chatroom objects.

Author
Jan Posselt <jposselt at databay.de>
Version
$Id$

Definition at line 16 of file class.ilObjChatroomAccess.php.

Member Function Documentation

◆ _checkAccess()

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

Please do not check any preconditions handled by ilConditionHandler here. Also don't do any RBAC checks.

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 75 of file class.ilObjChatroomAccess.php.

76 {
77 global $ilUser, $rbacsystem;
78
79 if (self::$chat_enabled === null) {
80 $chatSetting = new ilSetting('chatroom');
81 self::$chat_enabled = (boolean) $chatSetting->get('chat_enabled');
82 }
83
84 if ($a_user_id == "")
85 {
86 $a_user_id = $ilUser->getId();
87 }
88
89 if ($rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id)) {
90 return true;
91 }
93 }
ILIAS Setting Class.
global $ilUser
Definition: imgupload.php:15

References $chat_enabled, and $ilUser.

◆ _getCommands()

ilObjChatroomAccess::_getCommands ( )

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

Returns
string

Reimplemented from ilObjectAccess.

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

32 {
33 $commands = array();
34 $commands[] = array("permission" => "read", "cmd" => "view", "lang_var" => "enter", "default" => true);
35 $commands[] = array("permission" => "write", "cmd" => "settings-general", "lang_var" => "settings");
36
37 // alex 3 Oct 2012: this leads to a blank screen, i guess it is a copy/paste bug from files
38 //$commands[] = array("permission" => "write", "cmd" => "versions", "lang_var" => "versions");
39
40 return $commands;
41 }

Referenced by ilObjChatroomListGUI\init().

+ Here is the caller graph for this function:

◆ canBeDelivered()

ilObjChatroomAccess::canBeDelivered ( ilWACPath  $ilWACPath)

Parameters
ilWACPath$ilWACPath
Returns
bool

Implements ilWACCheckingClass.

Definition at line 98 of file class.ilObjChatroomAccess.php.

99 {
100 if(preg_match("/chatroom\\/smilies\\//ui", $ilWACPath->getPath()))
101 {
102 return true;
103 }
104
105 return false;
106 }

References ilWACPath\getPath().

+ Here is the call graph for this function:

Field Documentation

◆ $chat_enabled

ilObjChatroomAccess::$chat_enabled = null
staticprivate

Definition at line 73 of file class.ilObjChatroomAccess.php.

Referenced by _checkAccess().


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