You are here

function _crumbs_user_access_or in Crumbs, the Breadcrumbs suite 7.2

Access callback that checks more than one permission with OR.

Parameters

string[] $permissions:

object|null $account:

Return value

bool

1 call to _crumbs_user_access_or()
_crumbs_user_access_and in includes/crumbs.callbacks.inc
Access callback that checks more than one permission with AND.

File

includes/crumbs.callbacks.inc, line 59

Code

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