Function __global->has_privilege_group

Definitions

sources/permissions2.php

  • Find if a group has a specified privilege.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$group_id GROUP No No required parameter N/A N/A The being checked whether to have the privilege
$privilege ID_TEXT No No required parameter N/A N/A The privilege being checked for
$page ?ID_TEXT No No Null N/A N/A The page being checked (null: current page)
$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)

Returns

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

Preview

Code (PHP)

/**
 * Find if a group has a specified privilege.
 *
 * @param  GROUP $group_id The being checked whether to have the privilege
 * @param  ID_TEXT $privilege The privilege being checked for
 * @param  ?ID_TEXT $page The page being checked (null: current page)
 * @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)
 * @return boolean Whether the member has the privilege
 */

function has_privilege_group(int $group_id, string $privilege, ?string $page = null, ?array $cats = null) : bool