function entity_clone_entity_access in Entity Clone 8
Implements hook_entity_access().
File
- ./
entity_clone.module, line 141 - Contains entity_clone.module.
Code
function entity_clone_entity_access(EntityInterface $entity, $operation, AccountInterface $account) {
if ($operation === 'clone') {
return AccessResult::allowedIfHasPermission($account, 'clone ' . $entity
->getEntityTypeId() . ' entity');
}
return AccessResult::neutral();
}