Skip to content

Commit

Permalink
CIVIPLMMSR-199: Allow users with 'administer ManualDirectDebit' permi…
Browse files Browse the repository at this point in the history
…ssion to be able to delete mandates
  • Loading branch information
omarabuhussein committed Mar 4, 2024
1 parent 2ae1c1e commit 5433855
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion manualdirectdebit.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ function manualdirectdebit_civicrm_permission(&$permissions) {
];
}

/**
* Implements hook_civicrm_alterAPIPermissions().
*
*/
function manualdirectdebit_civicrm_alterAPIPermissions($entity, $action, &$params, &$permissions) {
if ($entity == 'manual_direct_debit' && $action == 'deletemandate') {
$permissions[$entity][$action] = ['administer ManualDirectDebit'];
}
}

/**
* Implements hook_civicrm_navigationMenu().
*
Expand Down Expand Up @@ -392,9 +402,9 @@ function manualdirectdebit_civicrm_searchTasks($objectName, &$tasks) {
'result' => FALSE,
];
}

}


function manualdirectdebit_civicrm_container($container) {
$priorityHigherThanCoreServices = -1;
$container->findDefinition('dispatcher')
Expand Down

0 comments on commit 5433855

Please sign in to comment.