You are here

public function AccessByOgMembershipTest::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/AccessByOgMembershipTest.php, line 216

Class

AccessByOgMembershipTest
Tests access to content by OgMembership.

Namespace

Drupal\Tests\og\Kernel\Access

Code

public function entityOperationAccessProvider() {
  return [
    [
      // Members should have the right to edit any group content.
      'member',
      [
        'owner' => TRUE,
        'member' => TRUE,
        'blocked' => TRUE,
      ],
    ],
    [
      // Non-members should have the right to edit any group content.
      'non-member',
      [
        'owner' => TRUE,
        'member' => TRUE,
        'blocked' => TRUE,
      ],
    ],
    [
      // Blocked members cannot edit any group content, not even their own.
      'blocked',
      [
        'owner' => FALSE,
        'member' => FALSE,
        'blocked' => FALSE,
      ],
    ],
  ];
}