node_access_example_permission
- Versions
- 7
node_access_example_permission()
Implementation of hook_permission().
In this example, we will use a simple permission to determine whether a user has access to "private" content. This permission is defined here.
Code
developer/examples/node_access_example.module, line 25
<?php
function node_access_example_permission() {
return array(
'access private content' => array(
'title' => t('Access private content'),
'description' => t('May view posts that are marked private.'),
),
'edit private content' => array(
'title' => t('Edit private content'),
'description' => t('May edit posts that are marked private.'),
),
);
}
?>Login or register to post comments 