function UserAccessControlHandlerTest::passwordAccessProvider

Same name in other branches
  1. 8.9.x core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php \Drupal\Tests\user\Unit\UserAccessControlHandlerTest::passwordAccessProvider()
  2. 10 core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php \Drupal\Tests\user\Unit\UserAccessControlHandlerTest::passwordAccessProvider()
  3. 11.x 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 336

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.