5 * OAuthSysToken entity.
7 * Provided by the OAuth Client extension.
11 class OAuthSysToken
extends Generic\DAOEntity
{
14 * Load and conditionally refresh a stored token.
16 * @param bool $checkPermissions
17 * @return \Civi\Api4\Action\OAuthSysToken\Refresh
19 public static function refresh($checkPermissions = TRUE) {
20 $action = new \Civi\Api4\Action\OAuthSysToken\
Refresh(static::class, __FUNCTION__
);
21 return $action->setCheckPermissions($checkPermissions);
24 public static function permissions() {
26 'meta' => ['access CiviCRM'],
27 'default' => ['manage OAuth client'],
28 'delete' => ['manage OAuth client'],
29 'get' => ['manage OAuth client'],
30 'refresh' => ['manage OAuth client'],
31 'create' => ['manage OAuth client secrets'],
32 'update' => ['manage OAuth client secrets'],
33 // In theory, there might be cases to 'create' or 'update' an OAuthSysToken
34 // without access to its secrets, but you should think through the
35 // lifecycle/errors/permissions. For now, easier to limit 'create'/update'.