Commit | Line | Data |
---|---|---|
d55f710f NM |
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 get($checkPermissions = TRUE) { | |
21 | $action = new Action\OAuthContactToken\Get(static::class, __FUNCTION__); | |
22 | return $action->setCheckPermissions($checkPermissions); | |
23 | } | |
24 | ||
25 | public static function update($checkPermissions = TRUE) { | |
26 | $action = new Action\OAuthContactToken\Update(static::class, __FUNCTION__); | |
27 | return $action->setCheckPermissions($checkPermissions); | |
28 | } | |
29 | ||
30 | public static function delete($checkPermissions = TRUE) { | |
31 | $action = new Action\OAuthContactToken\Delete(static::class, __FUNCTION__); | |
32 | return $action->setCheckPermissions($checkPermissions); | |
33 | } | |
34 | ||
35 | public static function permissions(): array { | |
36 | return [ | |
37 | 'meta' => ['access CiviCRM'], | |
38 | 'default' => [ | |
39 | [ | |
40 | 'manage my OAuth contact tokens', | |
41 | 'manage all OAuth contact tokens', | |
42 | ], | |
43 | ], | |
44 | ]; | |
45 | } | |
46 | ||
47 | } |