Function __global->has_attachment_access

Definitions

sources/attachments.php

  • Find if the specified member has access to view the specified attachment.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$member_id MEMBER No No required parameter N/A N/A The member being checked whether to have the access
$id AUTO_LINK No No required parameter N/A N/A The attachment being checked
$db ?object No No Null N/A N/A The database connector to use (null: site DB)

Returns

  • Whether the member has attachment access
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Find if the specified member has access to view the specified attachment.
 *
 * @param  MEMBER $member_id The member being checked whether to have the access
 * @param  AUTO_LINK $id The attachment being checked
 * @param  ?object $db The database connector to use (null: site DB)
 * @return boolean Whether the member has attachment access
 */

function has_attachment_access(int $member_id, int $id, ?object $db = null) : bool