function taxonomy_permissions_entity_insert in Taxonomy Permissions 8
Implements hook_entity_insert().
File
Code
function taxonomy_permissions_entity_insert(EntityInterface $entity) {
if ($entity
->getEntityTypeId() == 'taxonomy_vocabulary') {
$perms[] = 'view terms in ' . $entity
->id();
user_role_grant_permissions(AccountInterface::ANONYMOUS_ROLE, $perms);
user_role_grant_permissions(AccountInterface::AUTHENTICATED_ROLE, $perms);
}
}