Function __global->get_permission_where_clause_groups

Definitions

sources/permissions.php

  • Get the SQL WHERE clause to select for any usergroups the given member is in (gets combined with some condition(s), to check against every usergroup).
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$member_id MEMBER No No required parameter N/A N/A The member who's usergroups will be OR'd
$consider_clubs boolean No No True N/A N/A Whether to consider clubs (pass this false if considering page permissions, which work via explicit-denys across all groups, which could not happen for clubs as those denys could not have been set in the UI)
$field_prefix string No No Blank (empty string) N/A N/A Prefix (based on table aliasing) for field name

Returns

  • The SQL query fragment (null: admin, so permission regardless)
  • Type: ?string
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get the SQL WHERE clause to select for any usergroups the given member is in (gets combined with some condition(s), to check against every usergroup).
 *
 * @param  MEMBER $member_id The member who's usergroups will be OR'd
 * @param  boolean $consider_clubs Whether to consider clubs (pass this false if considering page permissions, which work via explicit-denys across all groups, which could not happen for clubs as those denys could not have been set in the UI)
 * @param  string $field_prefix Prefix (based on table aliasing) for field name
 * @return ?string The SQL query fragment (null: admin, so permission regardless)
 */

function get_permission_where_clause_groups(int $member_id, bool $consider_clubs = true, string $field_prefix = '') : ?string