Function __global->has_privacy_access

Definitions

sources/content_privacy.php

  • Check to see if some content may be viewed.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$content_type ID_TEXT No No required parameter N/A N/A The content type
$content_id ID_TEXT No No required parameter N/A N/A The content ID
$viewing_member_id ?MEMBER No No Null N/A N/A Viewing member to check privacy against (null: current member)
$additional_or string No No Blank (empty string) N/A N/A Additional OR clause for letting the user through
$submitter ?MEMBER No No Null N/A N/A Member owning the content (null: do dynamically in query via content hook). Usually pass as null

Returns

  • Whether there is access
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Check to see if some content may be viewed.
 *
 * @param  ID_TEXT $content_type The content type
 * @param  ID_TEXT $content_id The content ID
 * @param  ?MEMBER $viewing_member_id Viewing member to check privacy against (null: current member)
 * @param  string $additional_or Additional OR clause for letting the user through
 * @param  ?MEMBER $submitter Member owning the content (null: do dynamically in query via content hook). Usually pass as null
 * @return boolean Whether there is access
 */

function has_privacy_access(string $content_type, string $content_id, ?int $viewing_member_id = null, string $additional_or = '', ?int $submitter = null) : bool