You are here

function farm_quick_access in farmOS 7

Quick form access callback.

Parameters

$permissions: An array of permissions, such as "administer nodes", being checked for.

$account: (optional) The account to check, if not given use currently logged in user.

Return value

bool Boolean TRUE if the user has ALL the requested permissions.

1 string reference to 'farm_quick_access'
farm_quick_menu in modules/farm/farm_quick/farm_quick.module
Implements hook_menu().

File

modules/farm/farm_quick/farm_quick.module, line 169
Code for the Farm Quick module.

Code

function farm_quick_access($permissions, $account = NULL) {
  $grant = TRUE;
  foreach ($permissions as $permission) {
    if (!user_access($permission, $account)) {
      $grant = FALSE;
      break;
    }
  }
  return $grant;
}