You are here

function blog_access in Drupal 5

Same name and namespace in other branches
  1. 4 modules/blog.module \blog_access()
  2. 6 modules/blog/blog.module \blog_access()

Implementation of hook_access().

File

modules/blog/blog.module, line 31
Enables keeping an easily and regularly updated web page or a blog.

Code

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;
    }
  }
}