You are here

function invoice_user_access_handler in Invoice 7

Same name and namespace in other branches
  1. 6 invoice.module \invoice_user_access_handler()

User access handler to support multiple permissions for a menu item

Parameters

array $permissions:

Return value

boolean

1 string reference to 'invoice_user_access_handler'
invoice_menu in ./invoice.module
Implements hook_menu()

File

./invoice.module, line 182
Invoice module

Code

function invoice_user_access_handler(array $permissions = array()) {
  $allow = FALSE;
  if (count($permissions) > 0) {
    foreach ($permissions as $permission) {
      if (user_access($permission)) {
        $allow = TRUE;
        break;
      }
    }
  }
  else {
    $allow = TRUE;
  }
  return $allow;
}