Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
taxonomy_manager
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
taxonomy_manager
Commits
af080e2e
Commit
af080e2e
authored
9 months ago
by
Liam Morland
Committed by
Vladimir Roudakov
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3449448
: Unable to edit terms without 'administer taxonomy' permission
parent
03c9b952
Branches
Branches containing commit
Tags
2.0.12
Tags containing commit
1 merge request
!38
Issue #3449448 by Liam Morland: Allow editing terms with 'edit terms in VOCABULARY' permission
Pipeline
#226723
failed
9 months ago
Stage: build
Stage: validate
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Access/TaxonomyManagerAccessCheck.php
+6
-2
6 additions, 2 deletions
src/Access/TaxonomyManagerAccessCheck.php
with
6 additions
and
2 deletions
src/Access/TaxonomyManagerAccessCheck.php
+
6
−
2
View file @
af080e2e
...
...
@@ -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
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment