You are here

function _crumbs_user_access_and in Crumbs, the Breadcrumbs suite 7.2

Access callback that checks more than one permission with AND.

Used for admin/structure/crumbs/debug/devel

Parameters

array $permissions:

object|null $account:

Return value

bool

1 call to _crumbs_user_access_and()
_crumbs_user_access_or in includes/crumbs.callbacks.inc
Access callback that checks more than one permission with OR.
1 string reference to '_crumbs_user_access_and'
crumbs_menu in ./crumbs.info.inc
Implements hook_menu().

File

includes/crumbs.callbacks.inc, line 35

Code

function _crumbs_user_access_and(array $permissions, $account = NULL) {
  foreach ($permissions as $permission) {
    if (is_string($permission)) {
      if (!user_access($permission, $account)) {
        return FALSE;
      }
    }
    elseif (is_array($permission)) {
      if (!_crumbs_user_access_or($permission, $account)) {
        return FALSE;
      }
    }
  }
  return TRUE;
}