access

Summary

Checks if the current user has access to a given functionality

Usage

fetch( 'content', 'access',
       hash( 'access', access,
             'contentobject', contentobject,
             [ 'contentclass_id', contentclass_id, ]
             [ 'parent_contentclass_id', parent_contentclass_id ] ) )

Parameters

NameTypeDescriptionRequired
access string The access type in the content module to check Yes.
contentobject object The contentobject or contentobject node to do the checking on Yes.
contentclass_id integer,string The ID of the contentclass to include in check No.
parent_contentclass_id integer,string The ID of the contentclass of the parent node to include in check No.

Returns

Returns true if the access is allowed by the current user

Description

This fetch can be used to figure out if the current user has access (read, write, create, delete etc.) to a given object or node.

Note: When checking create access and the contentclass_id is not specified it will return true as long as there is a create access for this object, the user could still not be allowed to create a specific class.

Examples

Check if the node $node can be read by the user

fetch( 'content', 'access',

      hash( 'access', 'read',

            'contentobject', $node ) )

Checking if a given class can be created at the current node by the user

fetch( 'content', 'access',

      hash( 'access', 'create',

            'contentobject', $node,

            'contentclass_id', 'folder' ) )

Comments

Contents

Reference

Database diagram
Template operators
Template functions
Data fetching
    Class
    Content
       access
       bookmarks
       can_instantiate_class_list
       can_instantiate_classes
       class
       class_attribute
       class_attribute_list
       collected_info_collection
       collected_info_count
       collected_info_count_list
       contentobject_attributes
       draft_count
       draft_version_list
       keyword
       keyword_count
       list
       list_count
       locale_list
       navigation_parts
       node
       non_translation_list
       object
       object_by_attribute
       object_count_by_user_id
       pending_count
       pending_list
       recent
       same_classattribute_node
       search
       section_list
       tipafriend_top_list
       translation_list
       trash_count
       trash_object_list
       tree
       tree_count
       version
       version_count
       version_list
       view_top_list
    Collaboration
    Layout
    Notification
    Package
    Section
    Shop
    URL
    User
Modules
XML tags


Created

01/06/2004
6:52:17 pm
by Jan Borsodi

Last updated

01/06/2004
6:52:17 pm
by Jan Borsodi

Authors

Jan Borsodi



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.