fetch( 'user', 'has_access_to' )
Defined in kernel/user/function_definition.php; it calls eZUserFunctionCollection::hasAccessTo() (kernel/user/ezuserfunctioncollection.php).
Parameters
| Parameter | Type | Required | Default |
|---|---|---|---|
module | string | yes | |
function | string | yes | |
user_id | integer | no |
Example
In a template (the values are placeholders of each parameter's type):
{def $result = fetch( 'user', 'has_access_to', hash( 'module', 'module',
'function', 'function' ) )}
{* with every parameter *}
{def $all = fetch( 'user', 'has_access_to', hash( 'module', 'module',
'function', 'function',
'user_id', 1 ) )}In PHP, the same function through the function handler (lib/ezutils/classes/ezfunctionhandler.php):
$result = eZFunctionHandler::execute( 'user', 'has_access_to', array( 'module' => 'module', 'function' => 'function' ) );In a shipped template
The first use in the templates of this installation, design/admin/templates/content/edit.tpl line 64:
if and( ezini( 'NotificationSettings', 'PublishWithoutNotification', 'notification.ini' )|eq( 'enabled' ), fetch( 'user', 'has_access_to', hash( 'module', 'content', 'function', 'publish_without_notification' ) ) )Related
Generated by ./console exp:help:examples from kernel/user/function_definition.php, kernel/user/ezuserfunctioncollection.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.