For now, the function which is checking access to create a term is like this (in TaxonomyPermissionsControlHandler.php
):
protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
return AccessResult::allowedIfHasPermission($account, 'administer taxonomy');
}
This is not inline with another function in the same class:
protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
switch ($operation) {
...
case 'create':
return AccessResult::allowedIfHasPermissions(
$account,
[
"create terms in {$entity->bundle()}",
'administer taxonomy',
],
'OR');
...
}
And this is not inline with the fact that if we provide the "create terms in $entity_bundle" to a role, we expect it will alllow to create a term.
I would recommend to change the function like the following:
protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
return AccessResult::allowedIfHasPermissions($account, ["create terms in $entity_bundle", 'administer taxonomy'], 'OR');
}
Note: this is the way the original TermAccessControlHandler
(from core) was handling it.