Skip to content
Snippets Groups Projects
Commit c8ca8e91 authored by lpeidro's avatar lpeidro Committed by Luis Ruiz Peidró
Browse files

Issue #3500565: Check if the user has permission to check the Entity Mesh report

parent 4c8eea28
No related branches found
No related tags found
No related merge requests found
......@@ -106,6 +106,10 @@ function entity_mesh_process_entity(EntityInterface $entity, $operation) {
* in other places.
*/
function entity_mesh_form_alter(&$form, $form_state, $form_id) {
if (!\Drupal::currentUser()->hasPermission('access entity_mesh report')) {
return;
}
if (!str_ends_with($form_id, '_delete_form')) {
return;
}
......@@ -121,6 +125,10 @@ function entity_mesh_form_alter(&$form, $form_state, $form_id) {
* Implements hook_form_FORM_ID_alter().
*/
function entity_mesh_form_node_delete_multiple_confirm_form_alter(&$form, FormStateInterface $form_state, $form_id) {
if (!\Drupal::currentUser()->hasPermission('access entity_mesh report')) {
return;
}
$storage = \Drupal::service('entity_type.manager')->getStorage('node');
foreach (array_keys($form["entities"]["#items"]) as $key) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment