You are here

function forena_check_all_access in Forena Reports 7.4

Same name and namespace in other branches
  1. 8 forena.module \forena_check_all_access()
  2. 7.5 forena.module \forena_check_all_access()
  3. 7.3 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.:

2 calls to forena_check_all_access()
FrxEditor::load in ./FrxEditor.inc
Load report from file system
FrxReportGenerator::report in ./FrxReportGenerator.inc
Load and render a report based on a drupal path. In this function the arglist is used to get the full path to the report.
1 string reference to 'forena_check_all_access'
FrxMenu::addMenuItems in ./FrxMenu.inc
Add menu items to the items array

File

./forena.module, line 1182

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;
}