You are here

function ctools_access_multiperm in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 ctools.module \ctools_access_multiperm()

Determine if the current user has access via checks to multiple different permissions.

This function is a thin wrapper around user_access that allows multiple permissions to be easily designated for use on, for example, a menu callback.

Parameters

...: An indexed array of zero or more permission strings to be checked by user_access().

Return value

bool Iff all checks pass will this function return TRUE. If an invalid argument is passed (e.g., not a string), this function errs on the safe said and returns FALSE.

1 string reference to 'ctools_access_multiperm'
page_manager_page_menu in page_manager/plugins/tasks/page.admin.inc
Delegated implementation of hook_menu().

File

./ctools.module, line 939
CTools primary module file.

Code

function ctools_access_multiperm() {
  foreach (func_get_args() as $arg) {
    if (!is_string($arg) || !user_access($arg)) {
      return FALSE;
    }
  }
  return TRUE;
}