You are here

function forena_check_all_access in Forena Reports 7.5

Same name and namespace in other branches
  1. 8 forena.module \forena_check_all_access()
  2. 7.3 forena.module \forena_check_all_access()
  3. 7.4 forena.module \forena_check_all_access()

Used in hook_menu to test access to menu items.

Parameters

$checks array key value of callbacks and args to check.:

1 call to forena_check_all_access()
ReportEditor::load in src/Editor/ReportEditor.php
Load report from file system
1 string reference to 'forena_check_all_access'
Menu::addMenuItems in src/Menu.php
Add menu items to the items array

File

./forena.module, line 1121

Code

function forena_check_all_access($checks) {

  // Check each callback function to see if we have an error.
  $access = FALSE;

  // Check each callback function to see if we have an error.
  if ($checks) {
    foreach ($checks as $provider => $callbacks) {
      if (user_access('access ' . $provider . ' data')) {
        foreach ($callbacks as $callback => $args) {
          if ($callback) {
            foreach ($args as $arg) {
              if (function_exists($callback) && $arg) {
                $a = $callback($arg);
                if ($a) {
                  $access = TRUE;
                }
              }
              else {
                $access = TRUE;
              }
            }
          }
          else {
            $access = TRUE;
          }
        }
      }
    }
  }
  return $access;
}