Function __global->has_actual_page_access

Definitions

sources/permissions.php

  • Find if a member has access to a specified page. Zone permissions are taken into account for wherever the page is found at. Also support for category access and privileges. No support for entry-point checks, which are only carried out as an extension of page permissions when actually at a page.
  • 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 Null N/A N/A The member being checked whether to have the access (null: current member)
$page ?ID_TEXT No No Null N/A N/A The page being checked (null: current page)
$zone ?ID_TEXT No No Null N/A N/A The zone being checked (null: search)
$cats ?array No No Null N/A N/A A list of cat details to require access to (c-type-1,c-id-1,c-type-2,c-d-2,...) (null: N/A)
$privilege ?mixed No No Null N/A N/A Either the ID code of a privilege, an array of alternatives that are acceptable (null: none required)

Returns

  • Whether the member has zone and page access
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Find if a member has access to a specified page. Zone permissions are taken into account for wherever the page is found at. Also support for category access and privileges. No support for entry-point checks, which are only carried out as an extension of page permissions when actually at a page.
 *
 * @param  ?MEMBER $member_id The member being checked whether to have the access (null: current member)
 * @param  ?ID_TEXT $page The page being checked (null: current page)
 * @param  ?ID_TEXT $zone The zone being checked (null: search)
 * @param  ?array $cats A list of cat details to require access to (c-type-1,c-id-1,c-type-2,c-d-2,...) (null: N/A)
 * @param  ?mixed $privilege Either the ID code of a privilege, an array of alternatives that are acceptable (null: none required)
 * @return boolean Whether the member has zone and page access
 */

function has_actual_page_access(?int $member_id = null, ?string $page = null, ?string $zone = null, ?array $cats = null, $privilege = null) : bool