From 9959dad1787cb6db91cd2204d0fb5058b3181b40 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 26 Oct 2020 16:28:36 -0700 Subject: [PATCH] dev/core#2141 - Permissions - Define 'manage OAuth client' and 'manage OAuth client secrets' --- ext/oauth-client/oauth_client.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ext/oauth-client/oauth_client.php b/ext/oauth-client/oauth_client.php index 842ee0b593..7865798986 100644 --- a/ext/oauth-client/oauth_client.php +++ b/ext/oauth-client/oauth_client.php @@ -89,6 +89,24 @@ function oauth_client_civicrm_managed(&$entities) { _oauth_client_civix_civicrm_managed($entities); } +/** + * Implements hook_civicrm_permission(). + * + * @see CRM_Utils_Hook::permission() + * @see CRM_Core_Permission::getCorePermissions() + */ +function oauth_client_civicrm_permission(&$permissions) { + $prefix = ts('CiviCRM') . ': '; + $permissions['manage OAuth client'] = [ + $prefix . ts('manage OAuth client'), + ts('Create and delete OAuth client connections'), + ]; + $permissions['manage OAuth client secrets'] = [ + $prefix . ts('manage OAuth client secrets'), + ts('Access OAuth secrets'), + ]; +} + /** * Implements hook_civicrm_caseTypes(). * -- 2.25.1