Skip to content

Commit

Permalink
feat(shs-5086): add delete local task for developer users
Browse files Browse the repository at this point in the history
  • Loading branch information
cienvaras committed Nov 27, 2023
1 parent 4eb18bb commit 68e121c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docroot/modules/humsci/hs_admin/hs_admin.module
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ function hs_admin_toolbar_alter(&$items) {
* Implements hook_menu_local_tasks_alter().
*/
function hs_admin_menu_local_tasks_alter(&$data, $route_name, RefinableCacheableDependencyInterface &$cacheability) {
// Disable edit/create node tabs for publish and delete.
// Disable edit/create node tabs for publish and delete (non-admin users).
unset($data['tabs'][0]['entity.node.publish']);
unset($data['tabs'][0]['entity.node.delete_form']);
if (!\Drupal::currentUser()->hasRole('administrator'))
unset($data['tabs'][0]['entity.node.delete_form']);
}

/**
Expand Down

0 comments on commit 68e121c

Please sign in to comment.