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.
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 syntax
Usage
// basic usage
$permissions = permissions();
// 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.236