Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
entity_mesh
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
entity_mesh
Commits
c8ca8e91
Commit
c8ca8e91
authored
3 months ago
by
lpeidro
Committed by
Luis Ruiz Peidró
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
entity_mesh.module
+8
-0
8 additions, 0 deletions
entity_mesh.module
with
8 additions
and
0 deletions
entity_mesh.module
+
8
−
0
View file @
c8ca8e91
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment