Commit e2c898cc authored by catch's avatar catch

Issue #2905213 by chr.fritsch, marcoscano, xjm, Berdir: Bring back 'access...

Issue #2905213 by chr.fritsch, marcoscano, xjm, Berdir: Bring back 'access media overview' permission
parent 278c50e0
......@@ -27,3 +27,7 @@ create media:
view all media revisions:
title: 'View all media revisions'
description: 'To view a revision, you also need permission to view the media item.'
access media overview:
title: 'Access media overview'
description: 'Users with this permission can access the media overview page.'
......@@ -12,7 +12,7 @@
* @group media
class MediaAccessTest extends MediaFunctionalTestBase {
class MediaAccessTest extends MediaUiFunctionalTest {
use AssertPageCacheContextsAndTagsTrait;
......@@ -64,7 +64,7 @@ public function testMediaAccess() {
$this->assertSame("The 'view media' permission is required and the media item must be published.", $access_result->getReason());
$this->grantPermissions($role, ['view media']);
$this->drupalGet('media/' . $media->id());
// Test 'create media' permission.
......@@ -107,6 +107,28 @@ public function testMediaAccess() {
$this->drupalGet('media/' . $media->id() . '/delete');
// Test the 'access media overview' permission.
$this->grantPermissions($role, ['access content overview']);
// Create a new role, which implicitly checks if the permission exists.
$mediaOverviewRole = $this->createRole(['access content overview', 'access media overview']);
$assert_session->elementExists('css', '.view-media');
$assert_session->linkByHrefExists('/media/' . $media->id());
$assert_session->linkByHrefExists('/media/' . $user_media->id());
......@@ -45,7 +45,7 @@ trait MediaFunctionalTestTrait {
* A non-admin test user account.
* @var \Drupal\Core\Session\AccountInterface
* @var \Drupal\user\UserInterface
protected $nonAdminUser;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment