You are here

function simplenews_access in Simplenews 5

Implementation of hook_access().

File

./simplenews.module, line 38

Code

function simplenews_access($op, $node) {
  global $user;
  if ($op == 'create') {
    if (user_access('create newsletter') || user_access('administer newsletters')) {
      return TRUE;
    }
  }
  if ($op == 'update' || $op == 'delete') {
    if (user_access('administer newsletters')) {
      return TRUE;
    }
    elseif (user_access('edit any newsletter')) {
      return TRUE;
    }
    elseif (user_access('edit own newsletter') && $user->uid == $node->uid) {
      return TRUE;
    }
  }
}