public function OgAccessHookTest::entityOperationAccessProvider in Organic groups 8
Data provider for ::testEntityOperationAccess().
Return value
array And array of test data sets. Each set consisting of:
- The name of the user to test.
- An associative array indicating whether the user should have the right to edit content owned by the user represented by the array key.
File
- tests/
src/ Kernel/ Access/ OgAccessHookTest.php, line 225
Class
- OgAccessHookTest
- Tests access through OG's implementation of hook_entity_access().
Namespace
Drupal\Tests\og\Kernel\AccessCode
public function entityOperationAccessProvider() {
return [
[
// The administrator should have the right to edit group content items
// owned by any user.
'group-admin',
[
'owner' => TRUE,
'member' => TRUE,
'blocked' => TRUE,
],
],
[
// Members should only have the right to edit their own group content.
'member',
[
'owner' => FALSE,
'member' => TRUE,
'blocked' => FALSE,
],
],
[
// The non-member cannot edit any group content.
'non-member',
[
'owner' => FALSE,
'member' => FALSE,
'blocked' => FALSE,
],
],
[
// The blocked member cannot edit any group content, not even their own.
'blocked',
[
'owner' => FALSE,
'member' => FALSE,
'blocked' => FALSE,
],
],
];
}