ibexa

Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.

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 4:22 pm)

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


Comments

There are no comments.