permissions() function
Get, find or save permissions ($permissions API variable as a function)
Accessing permissions() is exactly the same as accessing $permissions. Though there are a couple of optional
shortcuts available by providing an argument to this function.
Please note this method is and thus not intended to be called directly.
Example
// Get a permission
$p = permissions()->get('page-edit'); // regular syntax
$p = permissions('page-edit'); // shortcut syntax
// Find permissions
$ps = permissions()->find('name^=page'); // regular syntax
$ps = permissions('name^=page'); // shortcut syntaxInternal usage
// basic internal usage
$permissions = permissions();
// internal usage with all arguments
$permissions = permissions($selector = '');Arguments
| Name | Type(s) | Description |
|---|---|---|
$selector (optional) | string int |
|
Return value
Permissions Permission PageArray null NullPage
Functions methods and properties
API reference based on ProcessWire core version 3.0.252