blog_access

Definition

blog_access($op, $node)
modules/blog.module, line 25

Description

Implementation of hook_access().

Code

<?php
function blog_access($op, $node) {
  global $user;

  if ($op == 'create') {
    return user_access('edit own blog') && $user->uid;
  }

  if ($op == 'update' || $op == 'delete') {
    if (user_access('edit own blog') && ($user->uid == $node->uid)) {
      return TRUE;
    }
  }
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.