function workflow_type_test_workflow_access

Same name and namespace in other branches
  1. 9 core/modules/workflows/tests/modules/workflow_type_test/workflow_type_test.module \workflow_type_test_workflow_access()
  2. 8.9.x core/modules/workflows/tests/modules/workflow_type_test/workflow_type_test.module \workflow_type_test_workflow_access()

Implements hook_ENTITY_TYPE_access() for the Workflow entity type.

File

core/modules/workflows/tests/modules/workflow_type_test/workflow_type_test.module, line 38

Code

function workflow_type_test_workflow_access(WorkflowInterface $entity, $operation, AccountInterface $account) {
  if ($entity->getTypePlugin()
    ->getPluginId() === 'workflow_custom_access_type') {
    return WorkflowCustomAccessType::workflowAccess($entity, $operation, $account);
  }
  return AccessResult::neutral();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.