poll_access

Versions
4.6 – 5
poll_access($op, $node)
6
poll_access($op, $node, $account)

Implementation of hook_access().

Code

modules/poll/poll.module, line 62

<?php
function poll_access($op, $node, $account) {
  switch ($op) {
    case 'create':
      return user_access('create poll content', $account) ? TRUE : NULL;
    case 'update':
      return user_access('edit any poll content', $account) || (user_access('edit own poll content', $account) && ($node->uid == $account->uid)) ? TRUE : NULL;
    case 'delete':
      return user_access('delete any poll content', $account) || (user_access('delete own poll content', $account) && ($node->uid == $account->uid)) ? TRUE : NULL;
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.