fetch( 'user', 'user_role', hash( 'user_id', user_id ) )
Name | Type | Description | Required |
---|---|---|---|
user_id | integer | The user to fetch policies from | Yes. |
An array of hashes or FALSE.
This function will fetch the policies that are available for a user. The desired user's ID number must be specified using the "id" parameter. The function will return an array of policy structures or FALSE if no policies are available or if a non-existing user ID number is provided. The following table shows the structure of the hashes that make up the elements of the returned array.
Name | Type | Description |
---|---|---|
moduleName |
string |
The name of the module that the user has access to (* means all modules). |
functionName |
string |
The name of the function that the user has access to (* means all functions). |
limitation |
string |
The elements of the module and function that the user has access to (* means no limitations). |
{def $policies=fetch( 'user', 'user_role', hash( 'user_id', 42 ) )} {foreach $policies as $policy} {$policy.moduleName} / {$policy.functionName} / {$policy.limitation} <br /> {/foreach}
Outputs information about the policies that are available for user number 42.
Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.