You are here

function taxonomy_permissions_entity_delete in Taxonomy Permissions 8

Implements hook_entity_delete().

File

./taxonomy_permissions.module, line 87
taxonomy_permissions.module

Code

function taxonomy_permissions_entity_delete(EntityInterface $entity) {
  if ($entity
    ->getEntityTypeId() == 'taxonomy_vocabulary') {
    $perms[] = 'view terms in ' . $entity
      ->id();
    user_role_revoke_permissions(AccountInterface::ANONYMOUS_ROLE, $perms);
    user_role_revoke_permissions(AccountInterface::AUTHENTICATED_ROLE, $perms);
  }
}