Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
UDZ-106-26089 permission for sending notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
stankut committed Apr 29, 2022
1 parent 4aa0a6f commit 8567cf2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,20 @@ function valghalla_notifications_update_7103() {
user_role_grant_permissions($role->rid, $permissions);
}
}

/**
* Implements hook_update_N().
*
* Replacing permission.
* Adding permission 'administer valghalla notification entities' to those that
* have 'administer valghalla'
*
*/
function valghalla_notifications_update_7104() {
$roles = user_roles(TRUE, 'administer valghalla');
$permissions = array('administer valghalla notification entities');

foreach ($roles as $rid => $role_name) {
user_role_grant_permissions($rid, $permissions);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function valghalla_notifications_menu() {
'title' => 'Send besked til deltagere',
'description' => 'Her kan der udsendes besked til alle, eller udvalgte segmenter, af deltagere.',
'page callback' => 'valghalla_notifications_menu_block_page',
'access arguments' => array('administer valghalla'),
'access arguments' => array('administer valghalla notification entities'),
'type' => MENU_NORMAL_ITEM,
'weight' => -5,
);
Expand All @@ -39,13 +39,13 @@ function valghalla_notifications_menu() {
$items['valghalla/administration/sendto/%'] = array(
'page callback' => 'drupal_get_form',
'page arguments' => array('valghalla_notifications_send_message_form', 3),
'access arguments' => array('administer valghalla'),
'access arguments' => array('administer valghalla notification entities'),
'file' => 'includes/valghalla_notifications_form.inc',
);

$items['valghalla_notifications/ajax/view/%/%'] = array(
'page callback' => 'valghalla_notifications_ajax_view',
'access arguments' => array('administer valghalla'),
'access arguments' => array('administer valghalla notification entities'),
'page arguments' => array(3, 4),
);

Expand All @@ -68,7 +68,7 @@ function valghalla_notifications_menu() {
'title callback' => 'check_plain',
'page callback' => 'valghalla_notifications_send_create_template_node',
'page arguments' => array($gateway_id),
'access arguments' => array('administer valghalla'),
'access arguments' => array('administer valghalla notification entities'),
'file' => 'includes/valghalla_notifications_form.inc',
'type' => MENU_NORMAL_ITEM,
'weight' => -5,
Expand Down

0 comments on commit 8567cf2

Please sign in to comment.