You are here

public function UserAccessControlHandlerTest::passwordAccessProvider in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php \Drupal\Tests\user\Unit\UserAccessControlHandlerTest::passwordAccessProvider()

Provides test data for passwordAccessProvider().

File

core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php, line 337

Class

UserAccessControlHandlerTest
Tests the user access controller.

Namespace

Drupal\Tests\user\Unit

Code

public function passwordAccessProvider() {
  $pass_access = [
    [
      'viewer' => 'viewer',
      'target' => 'viewer',
      'view' => FALSE,
      'edit' => TRUE,
    ],
    [
      'viewer' => 'viewer',
      'target' => 'owner',
      'view' => FALSE,
      // Anyone with edit access to the user can also edit these fields. In
      // reality edit access will already be checked on entity level and the
      // user without view access will typically not be able to edit.
      'edit' => TRUE,
    ],
    [
      'viewer' => 'owner',
      'target' => 'viewer',
      'view' => FALSE,
      'edit' => TRUE,
    ],
    [
      'viewer' => 'admin',
      'target' => 'owner',
      'view' => FALSE,
      'edit' => TRUE,
    ],
  ];
  return $pass_access;
}