| Versionen | |
|---|---|
| drupal6 – drupal7 | blog_access($op, $node, $account) |
Implementation of hook_access().
modules/
<?php
function blog_access($op, $node, $account) {
switch ($op) {
case 'create':
// Anonymous users cannot post even if they have the permission.
return user_access('create blog entries', $account) && $account->uid ? TRUE : NULL;
case 'update':
return user_access('edit any blog entry', $account) || (user_access('edit own blog entries', $account) && ($node->uid == $account->uid)) ? TRUE : NULL;
case 'delete':
return user_access('delete any blog entry', $account) || (user_access('delete own blog entries', $account) && ($node->uid == $account->uid)) ? TRUE : NULL;
}
}
?>
Kommentare
Kommentar hinzufügen