Loading core/modules/user/src/Plugin/views/access/Role.php +1 −1 Changes for core/modules/user/src/Plugin/views/access/Role.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ public static function create(ContainerInterface $container, array $configuratio * {@inheritdoc} */ public function access(AccountInterface $account) { return array_intersect(array_filter($this->options['role']), $account->getRoles()); return !empty(array_intersect(array_filter($this->options['role']), $account->getRoles())); } /** Loading core/modules/user/tests/src/Functional/Views/AccessRoleTest.php +2 −2 Changes for core/modules/user/tests/src/Functional/Views/AccessRoleTest.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -50,8 +50,8 @@ public function testAccessRole() { $this->assertTrue($access_plugin instanceof Role, 'Make sure the right class got instantiated.'); // Test the access() method on the access plugin. $this->assertFalse($executable->display_handler->access($this->webUser)); $this->assertTrue($executable->display_handler->access($this->normalUser)); $this->assertSame(FALSE, $executable->display_handler->access($this->webUser)); $this->assertSame(TRUE, $executable->display_handler->access($this->normalUser)); $this->drupalLogin($this->webUser); $this->drupalGet('test-role'); Loading Loading
core/modules/user/src/Plugin/views/access/Role.php +1 −1 Changes for core/modules/user/src/Plugin/views/access/Role.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ public static function create(ContainerInterface $container, array $configuratio * {@inheritdoc} */ public function access(AccountInterface $account) { return array_intersect(array_filter($this->options['role']), $account->getRoles()); return !empty(array_intersect(array_filter($this->options['role']), $account->getRoles())); } /** Loading
core/modules/user/tests/src/Functional/Views/AccessRoleTest.php +2 −2 Changes for core/modules/user/tests/src/Functional/Views/AccessRoleTest.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -50,8 +50,8 @@ public function testAccessRole() { $this->assertTrue($access_plugin instanceof Role, 'Make sure the right class got instantiated.'); // Test the access() method on the access plugin. $this->assertFalse($executable->display_handler->access($this->webUser)); $this->assertTrue($executable->display_handler->access($this->normalUser)); $this->assertSame(FALSE, $executable->display_handler->access($this->webUser)); $this->assertSame(TRUE, $executable->display_handler->access($this->normalUser)); $this->drupalLogin($this->webUser); $this->drupalGet('test-role'); Loading