Oauth - Use selectWhereClause to check perms instead of overriding API4 Get
[civicrm-core.git] / ext / oauth-client / Civi / Api4 / OAuthContactToken.php
1 <?php
2
3
4 namespace Civi\Api4;
5
6 /**
7 * OAuthContactToken entity.
8 *
9 * Provided by the OAuth Client extension.
10 *
11 * @package Civi\Api4
12 */
13 class OAuthContactToken extends Generic\DAOEntity {
14
15 public static function create($checkPermissions = TRUE) {
16 $action = new Action\OAuthContactToken\Create(static::class, __FUNCTION__);
17 return $action->setCheckPermissions($checkPermissions);
18 }
19
20 public static function update($checkPermissions = TRUE) {
21 $action = new Action\OAuthContactToken\Update(static::class, __FUNCTION__);
22 return $action->setCheckPermissions($checkPermissions);
23 }
24
25 public static function delete($checkPermissions = TRUE) {
26 $action = new Action\OAuthContactToken\Delete(static::class, __FUNCTION__);
27 return $action->setCheckPermissions($checkPermissions);
28 }
29
30 public static function permissions(): array {
31 return [
32 'meta' => ['access CiviCRM'],
33 'default' => [
34 [
35 'manage my OAuth contact tokens',
36 'manage all OAuth contact tokens',
37 ],
38 ],
39 ];
40 }
41
42 }