Function __global->set_privilege
Definitions
sources/permissions3.php
- Sets the privilege of a usergroup.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $group_id | GROUP | No | No | required parameter | N/A | N/A | The usergroup having the permission set |
| $permission | ID_TEXT | No | No | required parameter | N/A | N/A | The codename of the permission |
| $value | boolean | No | No | required parameter | N/A | N/A | Whether the usergroup has the permission |
| $page | ?ID_TEXT | No | No | Null | N/A | N/A | The page being checked (null: current page) |
| $permission_module | ?ID_TEXT | No | No | Null | N/A | N/A | The permission module (null: none required) |
| $category_name | ?ID_TEXT | No | No | Null | N/A | N/A | The category-name/value for the permission (null: none required) |
Preview
Code (PHP)
/**
* Sets the privilege of a usergroup.
*
* @param GROUP $group_id The usergroup having the permission set
* @param ID_TEXT $permission The codename of the permission
* @param boolean $value Whether the usergroup has the permission
* @param ?ID_TEXT $page The page being checked (null: current page)
* @param ?ID_TEXT $permission_module The permission module (null: none required)
* @param ?ID_TEXT $category_name The category-name/value for the permission (null: none required)
*/
function set_privilege(int $group_id, string $permission, bool $value, ?string $page = null, ?string $permission_module = null, ?string $category_name = null)
* Sets the privilege of a usergroup.
*
* @param GROUP $group_id The usergroup having the permission set
* @param ID_TEXT $permission The codename of the permission
* @param boolean $value Whether the usergroup has the permission
* @param ?ID_TEXT $page The page being checked (null: current page)
* @param ?ID_TEXT $permission_module The permission module (null: none required)
* @param ?ID_TEXT $category_name The category-name/value for the permission (null: none required)
*/
function set_privilege(int $group_id, string $permission, bool $value, ?string $page = null, ?string $permission_module = null, ?string $category_name = null)
