Path

ez.no / documentation / ez publish / technical manual / 4.x / reference / modules / content / fetch functions / can_instantiate_classes


Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

can_instantiate_classes

Summary

Checks if the current user is allowed to create nodes.

Usage

fetch( 'content', 'can_instantiate_classes' [, hash( 'parent_node', parent_node ) ] )

Parameters

NameTypeDescriptionRequired
parent_node object Node to check if user can create new object in No.

Returns

TRUE if the current user is allowed to create nodes, FALSE otherwise.

Description

This fetch function checks if the current user is allowed to create nodes either below the current position within the tree or below a given node (specified by the "parent_node" parameter). The function will return TRUE if the current user is allowed to create nodes, otherwise FALSE will be returned.

Examples

Example 1

{if fetch( 'content', 'can_instantiate_classes' )}
    The current user can create nodes below the current node.
{else}
    The current user can not create nodes below the current node.
{/if}

Example 2

{def $target=fetch( 'content', 'node', hash( 'node_id', 64 )}
 
{if fetch( 'content', 'can_instantiate_classes', hash( 'parent_node', $target )}
    The current user can create nodes below node number 64.
{else}
    The current user can not create nodes below node number 64.
{/if}

Balazs Halasy (06/02/2004 12:01 pm)

Balazs Halasy (29/04/2005 8:21 am)


Comments

There are no comments.