Unverified Commit 6f29f980 authored by larowlan's avatar larowlan

Issue #3082287 by alexpott: \Drupal\user\Plugin\views\access\Role::access()...

Issue #3082287 by alexpott: \Drupal\user\Plugin\views\access\Role::access() does not conform to the base class documentation
parent 22f67831
......@@ -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()));
}
/**
......
......@@ -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');
......
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