function workflow_type_test_workflow_access in Drupal 8
Same name and namespace in other branches
- 9 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 - Module file for workflow_type_test.
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();
}