This is the old documentation center for eZ Publish 4. We are currently migrating the eZ Publish documentation to http://confluence.ez.no the eZ Publish 5 documentation platform. Documentation for the eZ Publish legacy components are still located on this site, as well as all documentation for earlier releases.

user_role

Summary

Fetches the policies that are available for a user.

Usage

fetch( 'user', 'user_role', hash( 'user_id', user_id ) )

Parameters

NameTypeDescriptionRequired
user_id integer The user to fetch policies from Yes.

Returns

An array of hashes or FALSE.

Description

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).

Examples

Example 1

{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.

Balazs Halasy (01/06/2004 6:22 pm)

Balazs Halasy (29/04/2005 11:32 am)


Comments

There are no comments.