Skip to content
Snippets Groups Projects
Commit 288bcc23 authored by Gregg Marshall's avatar Gregg Marshall Committed by Owen Bush
Browse files

Issue #3330386 by greggmarshall, owenbush: field_inheritance_form_alter should...

Issue #3330386 by greggmarshall, owenbush: field_inheritance_form_alter should enforce module permissions
parent 9ece7a40
No related branches found
No related tags found
2 merge requests!15Issue #3206976 by jrb, owenbush: If language for content is set to "und",...,!14Issue #3206976 by jrb, owenbush: If language for content is set to "und",...
......@@ -132,6 +132,9 @@ function field_inheritance_entity_bundle_field_info_alter(&$fields, EntityTypeIn
* Implements hook_form_alter().
*/
function field_inheritance_form_alter(&$form, FormStateInterface $form_state, $form_id) {
if (!\Drupal::currentUser()->hasPermission('administer field inheritance')) {
return;
}
$form_object = $form_state->getFormObject();
if (!empty($form_object) && $form_object instanceof EntityForm) {
$entity = $form_state->getFormObject()->getEntity();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment