ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
 _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)
- Public Member Functions inherited from ilObjectAccess
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id=0)
 check condition
 _checkGoto ($a_target)
 check whether goto script will succeed
 _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data.

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.

Detailed Description

Access class for chatroom objects.

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

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

Member Function Documentation

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

References $chat_enabled, and $ilUser.

{
global $ilUser, $rbacsystem;
if (self::$chat_enabled === null) {
$chatSetting = new ilSetting('chatroom');
self::$chat_enabled = (boolean) $chatSetting->get('chat_enabled');
}
if ($a_user_id == "")
{
$a_user_id = $ilUser->getId();
}
if ($rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id)) {
return true;
}
}
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 30 of file class.ilObjChatroomAccess.php.

Referenced by ilObjChatroomListGUI\init().

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

+ Here is the caller graph for this function:

Field Documentation

ilObjChatroomAccess::$chat_enabled = null
staticprivate

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

Referenced by _checkAccess().


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