You are here

function flexiform_access in Flexiform 7

Access callback for the entity API.

2 string references to 'flexiform_access'
flexiform_entity_info in ./flexiform.module
Implement hook_entity_info().
flexiform_webform_entity_info in flexiform_webform/flexiform_webform.module
Implements hook_entity_info().

File

./flexiform.module, line 216
Module for the Flexiform system.

Code

function flexiform_access($op, $flexiform = NULL, $account = NULL) {
  if (user_access('administer flexiforms', $account)) {
    return TRUE;
  }

  // Allow modules to grant / deny access.
  $access = module_invoke_all('flexiform_access', $op, $flexiform, $account);

  // Only grant access if at least one module granted access and no one denied
  // access.
  if (in_array(FALSE, $access, TRUE)) {
    return FALSE;
  }
  elseif (in_array(TRUE, $access, TRUE)) {
    return TRUE;
  }
  return FALSE;
}