From: Tim Otten Date: Mon, 26 Oct 2020 23:28:36 +0000 (-0700) Subject: dev/core#2141 - Permissions - Define 'manage OAuth client' and 'manage OAuth client... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9959dad1787cb6db91cd2204d0fb5058b3181b40;p=civicrm-core.git dev/core#2141 - Permissions - Define 'manage OAuth client' and 'manage OAuth client secrets' --- 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(). *