protected function FieldPermissionsUserTest::checkUserViewEditField in Field Permissions 8
Same name and namespace in other branches
- 8.2 tests/src/Functional/FieldPermissionsUserTest.php \Drupal\Tests\field_permissions\Functional\FieldPermissionsUserTest::checkUserViewEditField()
Tests custom permissions.
1 call to FieldPermissionsUserTest::checkUserViewEditField()
- FieldPermissionsUserTest::testUserFieldPermissions in tests/
src/ Functional/ FieldPermissionsUserTest.php - Test field permissions on user entities.
File
- tests/
src/ Functional/ FieldPermissionsUserTest.php, line 231
Class
- FieldPermissionsUserTest
- Test field permissions on users.
Namespace
Drupal\Tests\field_permissions\FunctionalCode
protected function checkUserViewEditField() {
$permission = [];
// AGGIUNGE I PERMESSI DI VIEW_OWN. all'utente limitato.
$this
->drupalLogin($this->webUser);
$perm = [
'view ' . $this->fieldName,
];
$permission = $this
->grantCustomPermissions($this->webUserRole, $perm, $permission);
$this
->setUserFieldPermission(FieldPermissionTypeInterface::ACCESS_CUSTOM, $permission);
$this
->assertUserFieldAccess($this->limitedUser);
$perm = [
'edit ' . $this->fieldName,
];
$permission = $this
->grantCustomPermissions($this->webUserRole, $perm, $permission);
$this
->setUserFieldPermission(FieldPermissionTypeInterface::ACCESS_CUSTOM, $permission);
$this
->assertUserEditFieldAccess($this->limitedUser);
$this
->drupalLogout();
}