You are here

function workflow_bundle_ctools_access_check in Workflow 7.2

Custom callback defined by 'callback' in the $plugin array.

Check for access.

1 string reference to 'workflow_bundle_ctools_access_check'
workflow_bundle.inc in workflow_node/plugins/access/workflow_bundle.inc
Describes a CTools Access plugin.

File

workflow_node/plugins/access/workflow_bundle.inc, line 32
Describes a CTools Access plugin.

Code

function workflow_bundle_ctools_access_check($conf, $context) {

  // For some unknown reason $context may not be set. We just want to be sure.
  if (empty($context) || empty($context->data) || empty($context->data->type)) {
    return FALSE;
  }

  // If the node's content type is not part of the selected workflow access to
  // the pane is denied.
  $type = $context->data->type;
  $workflow = workflow_get_workflow_type_map_by_type($type);
  if (isset($workflow->wid) && $conf['workflow_bundle'] == $workflow->wid) {
    return TRUE;
  }
  return FALSE;
}