roles

Summary

Fetches roles that have at least one policy limited to a certain section.

Usage

fetch( 'section', 'roles', hash( 'section_id', section_id ) )

Parameters

NameTypeDescriptionRequired
section_id integer The ID number of the target section. Yes.

Returns

An array (see below) or FALSE.

Description

This function returns a structure that contains information about roles which have at least one policy limited to a certain section. The function returns an array with two keys:

Name

Description

roles

Contains a list of roles with at least one policy limited to the given section.

limited_policies

Contains a 2D array (the role ID as the first key) of the limited policies.

Examples

Example 1

{def $roles_array=fetch( 'section', 'roles', hash( 'section_id', 13 ) )
     $roles=$roles_array.roles
     $policies=$roles_array.limited_policies}
 
{foreach $roles as $role}
    {$role.name}:
    {foreach $limited_policies[$role.id] as $policy}
        {$policy.module_name}/{$policy.function_name}
        {delimiter}, {/delimiter}
    {/foreach}
    <br />
{/foreach}

Outputs information about roles that have limitations associated with section number 13.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.