Function __global->add_privilege

Definitions

sources/permissions3.php

  • Add a privilege, and apply it to every usergroup.
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Return: array

Parameters

Name Type Default Set Range Description
$section ID_TEXT required parameter N/A N/A The section the privilege is filled under
$name ID_TEXT required parameter N/A N/A The codename for the privilege
$default boolean False N/A N/A Whether this privilege is granted to all usergroups by default
$not_even_mods boolean False N/A N/A Whether this privilege is not granted to supermoderators by default (something very sensitive); only applies if $default is true
$not_for_probation boolean False N/A N/A An exception for if $default is true, don't assign the privilege to the probation group
$insert boolean True N/A N/A Whether to insert into the database (if this is set to false you need to read the return parameters and do it yourself - which is used for efficient bulk inserts across many privileges at once)

Return

  • A pair: The map parameter for the group_privileges table, the map parameter for the privilege_list table
  • Type: array
  • Set: N/A
  • Range: N/A