dev/core#2141 - Permissions - Define 'manage OAuth client' and 'manage OAuth client...
authorTim Otten <totten@civicrm.org>
Mon, 26 Oct 2020 23:28:36 +0000 (16:28 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 3 Nov 2020 12:32:48 +0000 (04:32 -0800)
ext/oauth-client/oauth_client.php

index 842ee0b593a06f5caaa4d4f92aeceb6b28f12a45..786579898601e3044bd97392ebe3eb6bd2ebfd39 100644 (file)
@@ -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().
  *