poll_access

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

modules/poll/poll.module, строка 62

Версии
5
poll_access($op, $node)
6
poll_access($op, $node, $account)

Реализация метода hook_access()

Код

<?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;
  }
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему