modX.hasPermission

Skip to end of metadata
Go to start of metadata


modX::hasPermission

Returns true if user has the specified policy permission.

Syntax

API Doc: http://api.modxcms.com/modx/modX.html#hasPermission

boolean hasPermission (string $pm)

Example

Deny the user access if they don't have the permission 'edit_chunk' in their loaded Policies.

if (!$modx->hasPermission('edit_chunk')) die('Access Denied!');

See Also

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.