4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC. All rights reserved. |
7 | This work is published under the GNU AGPLv3 license with some |
8 | permitted exceptions and without any warranty. For full license |
9 | and copyright information, see https://civicrm.org/licensing |
10 +--------------------------------------------------------------------+
16 * @copyright CiviCRM LLC https://civicrm.org/licensing
21 namespace Civi\Api4\Action\Contact
;
23 use Civi\Api4\Generic\DAOGetFieldsAction
;
25 class GetFields
extends DAOGetFieldsAction
{
27 protected function getRecords() {
28 $fields = parent
::getRecords();
30 $apiKeyPerms = ['edit api keys', 'administer CiviCRM'];
31 if ($this->checkPermissions
&& !\CRM_Core_Permission
::check([$apiKeyPerms])) {
32 unset($fields['api_key']);