You are here

function workbench_workflows_guard in Workbench Moderation 7.2

Guard callback for the workbenchStates publish and unpublish events.

1 string reference to 'workbench_workflows_guard'
_workbench_workflows_state_flow_entity_plugins in modules/workbench_workflows/workbench_workflows.state_flow_entity.inc
Helper function for hook_state_flow_entity_plugins().

File

modules/workbench_workflows/workbench_workflows.module, line 329
workbench_workflows.module

Code

function workbench_workflows_guard($event) {
  $entity = $event
    ->get_machine()
    ->get_object();

  // Check if this is prohibited based on the events rules.
  if (!workbench_workflows_exportable_access($entity, $event->name, 'events')) {
    return FALSE;
  }
  else {
    return workbench_workflows_exportable_access($entity, $event
      ->get_option('target'), 'states');
  }
}