You are here

public function UserAccessControlHandlerTest::passwordAccessProvider in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 315
Contains \Drupal\Tests\user\Unit\UserAccessControlHandlerTest.

Class

UserAccessControlHandlerTest
Tests the user access controller.

Namespace

Drupal\Tests\user\Unit

Code

public function passwordAccessProvider() {
  $pass_access = array(
    array(
      'viewer' => 'viewer',
      'target' => 'viewer',
      'view' => FALSE,
      'edit' => TRUE,
    ),
    array(
      '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,
    ),
    array(
      'viewer' => 'owner',
      'target' => 'viewer',
      'view' => FALSE,
      'edit' => TRUE,
    ),
    array(
      'viewer' => 'admin',
      'target' => 'owner',
      'view' => FALSE,
      'edit' => TRUE,
    ),
  );
  return $pass_access;
}