Skip to content
Snippets Groups Projects
Verified Commit 158d0893 authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #3347816 by mpp, AlexGreen, lauriii: Only show link to taxonomy overview when user has access

(cherry picked from commit 16da1ce8)
(cherry picked from commit 01800acd)
parent 7e967372
Branches
Tags
11 merge requests!8394[warning] array_flip(): Can only flip STRING and INTEGER values, when saving a non-revisionable custom content entity,!7780issue 3443822: fix for 'No route found for the specified format html. Supported formats: json, xml.',!5013Issue #3071143: Table Render Array Example Is Incorrect,!4848Issue #1566662: Update module should send notifications on Thursdays,!4792Issue #2230689: Remove redundant "Italic" style,!4220Issue #3368223: Link field > Access to internal links is not checked on display.,!3884Issue #3356842,!3812Draft: Issue #3339373 by alexpott, andypost, mondrake:...,!2205Quote all names in the regions section.,!1459Issue #3087632: menu_name max length is too long,!866Issue #2845319: The highlighting of the 'Home' menu-link does not respect query strings and fragment identifiers
......@@ -109,6 +109,7 @@ protected function actions(array $form, FormStateInterface $form_state) {
'#value' => $this->t('Save and go to list'),
'#weight' => 20,
'#submit' => array_merge($element['submit']['#submit'], ['::overview']),
'#access' => $this->currentUser()->hasPermission('access taxonomy overview'),
];
}
......
......@@ -56,6 +56,7 @@ protected function setUp(): void {
$this->drupalLogin($this->drupalCreateUser([
'administer taxonomy',
'access taxonomy overview',
'bypass node access',
]));
$this->vocabulary = $this->createVocabulary();
......@@ -437,6 +438,15 @@ public function testTermInterface() {
// parameter is present.
$this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add', ['query' => ['destination' => 'node/add']]);
$this->assertSession()->pageTextNotContains('Save and go to list');
// Validate that "Save and go to list" doesn't exist when missing permission
// 'access taxonomy overview'.
$this->drupalLogin($this->drupalCreateUser([
'administer taxonomy',
'bypass node access',
]));
$this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add');
$this->assertSession()->pageTextNotContains('Save and go to list');
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment