From d76345c99b1a7c269b7efdb3fc06760c3e1febc8 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 27 Dec 2021 00:25:24 -0800 Subject: [PATCH] Queue APIv4 - Expose basic CRUD for queues (5.47 variant) --- CRM/Core/Permission.php | 8 ++++++++ Civi/Api4/Queue.php | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 Civi/Api4/Queue.php diff --git a/CRM/Core/Permission.php b/CRM/Core/Permission.php index 256efae208..98d074db2f 100644 --- a/CRM/Core/Permission.php +++ b/CRM/Core/Permission.php @@ -752,6 +752,14 @@ class CRM_Core_Permission { 'administer reserved tags' => [ $prefix . ts('administer reserved tags'), ], + 'administer queues' => [ + $prefix . ts('administer queues'), + ts('Initialize, browse, and cancel background processing queues'), + // At time of writing, we have specifically omitted the ability to edit fine-grained + // data about specific queue-tasks. Tasks are usually defined as PHP callables... + // and one should hesitate before allowing open-ended edits of PHP callables. + // However, it seems fine for web-admins to browse and cancel these things. + ], 'administer dedupe rules' => [ $prefix . ts('administer dedupe rules'), ts('Create and edit rules, change the supervised and unsupervised rules'), diff --git a/Civi/Api4/Queue.php b/Civi/Api4/Queue.php new file mode 100644 index 0000000000..7c4e337b87 --- /dev/null +++ b/Civi/Api4/Queue.php @@ -0,0 +1,35 @@ + ['access CiviCRM'], + 'default' => ['administer queues'], + ]; + } + +} -- 2.25.1