You are here

function newsletter_entity_access in Newsletter 7

Determines whether the given user has access to a subscriber/list/template.

See also

entity_access()

1 string reference to 'newsletter_entity_access'
newsletter_entity_info in ./newsletter.module
Implements hook_entity_info().

File

./newsletter.module, line 971
Defines menu items for newsletter administration, permissions and basic drupal hooks.

Code

function newsletter_entity_access($op, $entity = NULL, $account = NULL) {
  if (isset($entity->nlid) && $op == 'view') {

    // The entity is a newsletter list and we are in the subscribe form.
    return user_access('subscribe newsletters', $account);
  }
  return user_access('administer newsletters', $account);
}