You are here

function rotor_access in Rotor Banner 7

Same name and namespace in other branches
  1. 5.7 rotor.module \rotor_access()
  2. 6.2 rotor.module \rotor_access()
  3. 6 rotor.module \rotor_access()

Implementation of hook_access().

File

./rotor.module, line 43
A rotor banner consists in a set of images that will be changing. This module is made using jquery.

Code

function rotor_access($op, $node, $account) {
  if ($op == 'create') {
    return user_access('create rotor item');
  }
  if ($op == 'update') {
    if (user_access('edit any rotor item') || user_access('edit own rotor item') && $account->uid == $node->uid) {
      return TRUE;
    }
  }
  if ($op == 'delete') {
    if (user_access('delete any rotor item') || user_access('delete own rotor item') && $account->uid == $node->uid) {
      return TRUE;
    }
  }
}