if (!
$this->
hasScope($request, UserVerifiedScope::IDENTIFIER
)) { throw new AccessDeniedHttpException(sprintf('This access token does not have the scope "%s" to process this Request', UserVerifiedScope::IDENTIFIER
));
} /** @var AdminApiSource $source */
$source =
$context->
getSource();
if ( !
$source->
isAllowed('user:update'
) &&
$source->
getUserId() !==
$userId ) { throw new PermissionDeniedException();
} $context->
scope(Context::SYSTEM_SCOPE,
function DContext
$context) use ($userId): void
{ $this->userRepository->
delete([['id' =>
$userId]],
$context);
});
return $factory->
createRedirectResponse($this->userRepository->
getDefinition(),
$userId,
$request,
$context);
} #[Route(path: '/api/user/{userId}/access-keys/{id}', name: 'api.user_access_keys.delete', defaults: ['auth_required' => true, '_acl' => ['user_access_key:delete']], methods: ['DELETE'])]
public function deleteUserAccessKey(string
$id, Request
$request, Context
$context, ResponseFactoryInterface
$factory): Response
{