You are here

public function GroupLevelAccessTest::groupEntityOperationPermissionsTestProvider in Organic groups 8

Provides test data to check access to group level entity permissions.

See also

::testDefaultGroupPermissions()

File

tests/src/Kernel/Access/GroupLevelAccessTest.php, line 336

Class

GroupLevelAccessTest
Tests user access to group level entity operations and permissions.

Namespace

Drupal\Tests\og\Kernel\Access

Code

public function groupEntityOperationPermissionsTestProvider() : array {
  return [
    [
      // The user performing the entity operations.
      'owner',
      // Whether or not the user should have access to the group entity
      // operation.
      [
        'update' => TRUE,
        'delete' => TRUE,
      ],
    ],
    [
      'non-member',
      [
        'update' => FALSE,
        'delete' => FALSE,
      ],
    ],
    [
      'delete',
      [
        'update' => FALSE,
        'delete' => TRUE,
      ],
    ],
    [
      'update',
      [
        'update' => TRUE,
        'delete' => FALSE,
      ],
    ],
    [
      'admin',
      [
        'update' => TRUE,
        'delete' => TRUE,
      ],
    ],
    [
      'alternative-admin',
      [
        'update' => TRUE,
        'delete' => TRUE,
      ],
    ],
  ];
}