Function __global->check_chatroom_access

Definitions

sources/chat.php

  • Check whether a member has access to the chatroom.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$room mixed No No required parameter N/A N/A The row of the chatroom to check for access OR its ID (AUTO_LINK)
$ret boolean No No False N/A N/A Whether to return false if there is no access (as opposed to bombing out)
$member_id ?MEMBER No No Null N/A N/A The member to check as (null: current member)
$must_be_explicit boolean No No False N/A N/A Whether to also ensure for $member_id having explicit access

Returns

  • Whether the current member has access to the chatroom
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Check whether a member has access to the chatroom.
 *
 * @param  mixed $room The row of the chatroom to check for access OR its ID (AUTO_LINK)
 * @param  boolean $ret Whether to return false if there is no access (as opposed to bombing out)
 * @param  ?MEMBER $member_id The member to check as (null: current member)
 * @param  boolean $must_be_explicit Whether to also ensure for $member_id having explicit access
 * @return boolean Whether the current member has access to the chatroom
 */

function check_chatroom_access($room, bool $ret = false, ?int $member_id = null, bool $must_be_explicit = false) : bool