Skip to content
Snippets Groups Projects
Commit af080e2e authored by Liam Morland's avatar Liam Morland Committed by Vladimir Roudakov
Browse files

Issue #3449448: Unable to edit terms without 'administer taxonomy' permission

parent 03c9b952
Branches
Tags 2.0.12
1 merge request!38Issue #3449448 by Liam Morland: Allow editing terms with 'edit terms in VOCABULARY' permission
Pipeline #226723 failed
......@@ -33,8 +33,11 @@ class TaxonomyManagerAccessCheck implements AccessInterface {
if ($account->hasPermission('administer taxonomy')) {
return AccessResult::allowed()->cachePerPermissions();
}
$taxonomyVocabulary = $route_match->getParameter('taxonomy_vocabulary')
->id();
// Get the taxonomy vocabulary from the route. If there is not a taxonomy
// vocabulary as a route param, get it from the taxonomy_term param.
$taxonomyVocabulary = $route_match->getParameter('taxonomy_vocabulary')?->id() ?? $route_match->getParameter('taxonomy_term')?->bundle();
$routeName = $route_match->getRouteName();
switch ($routeName) {
case "taxonomy_manager.admin_vocabulary.delete":
......@@ -44,6 +47,7 @@ class TaxonomyManagerAccessCheck implements AccessInterface {
break;
case "taxonomy_manager.admin_vocabulary.move":
case 'taxonomy_manager.taxonomy_term.edit':
if ($account->hasPermission('edit terms in ' . $taxonomyVocabulary)) {
return AccessResult::allowed()->cachePerPermissions();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment