workbench_email_test.module in Workbench Email 8
Same filename and directory in other branches
Contains main module functions.
File
tests/modules/workbench_email_test/workbench_email_test.moduleView source
<?php
/**
* @file
* Contains main module functions.
*/
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface;
/**
* Implements hook_ENTITY_TYPE_access().
*/
function workbench_email_test_node_access(EntityInterface $entity, $operation, AccountInterface $account) {
if ($account
->getEmail() === 'editor2@example.com' && $operation === 'update') {
return AccessResult::forbidden();
}
return AccessResult::neutral();
}
Functions
Name | Description |
---|---|
workbench_email_test_node_access | Implements hook_ENTITY_TYPE_access(). |