Skip to content
Snippets Groups Projects
Commit e07bf5fd authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2337227 by er.pushpinderrana, larowlan: Fixed NodeAccessControlHandler...

Issue #2337227 by er.pushpinderrana, larowlan: Fixed NodeAccessControlHandler performs non-strict in_array check.
parent 29559424
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -140,13 +140,13 @@ protected function checkFieldAccess($operation, FieldDefinitionInterface $field_
// Only users with the administer nodes permission can edit administrative
// fields.
$administrative_fields = array('uid', 'status', 'created', 'promote', 'sticky');
if ($operation == 'edit' && in_array($field_definition->getName(), $administrative_fields)) {
if ($operation == 'edit' && in_array($field_definition->getName(), $administrative_fields, TRUE)) {
return AccessResult::allowedIfHasPermission($account, 'administer nodes');
}
// No user can change read only fields.
$read_only_fields = array('changed', 'revision_timestamp', 'revision_uid');
if ($operation == 'edit' && in_array($field_definition->getName(), $read_only_fields)) {
if ($operation == 'edit' && in_array($field_definition->getName(), $read_only_fields, TRUE)) {
return AccessResult::forbidden();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment