You are here

function botcha_form_access in BOTCHA Spam Prevention 7.2

Same name and namespace in other branches
  1. 6.2 botcha.module \botcha_form_access()
  2. 6.3 botcha.module \botcha_form_access()
  3. 7.3 botcha.module \botcha_form_access()

Check for restriction.

Parameters

BotchaForm $botcha_form:

1 string reference to 'botcha_form_access'
botcha_menu in ./botcha.module
Implements hook_menu().

File

./botcha.module, line 210

Code

function botcha_form_access($botcha_form) {
  $access = user_access('administer BOTCHA settings');

  // @todo Remove hardcode.
  if (in_array($botcha_form->id, array(
    'update_script_selection_form',
    'user_login',
    'user_login_block',
  )) && in_array($botcha_form
    ->getRecipebook()->id, array(
    'forbidden_forms',
  ))) {
    $access = FALSE;
  }
  return $access;
}