You are here

function panels_node_access in Panels 6.3

Same name and namespace in other branches
  1. 5.2 panels_node/panels_node.module \panels_node_access()
  2. 6.2 panels_node/panels_node.module \panels_node_access()

Implementation of hook_access().

File

panels_node/panels_node.module, line 102
panels_node.module

Code

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