if (!
$userId) { throw new ExpectedUserHttpException();
} $criteria =
new Criteria([$userId]);
$criteria->
addAssociation('aclRoles'
);
$user =
$this->userRepository->
search($criteria,
$context)->
first();
if (!
$user) { throw OAuthServerException::
invalidCredentials();
} return $responseFactory->
createDetailResponse(new Criteria(),
$user,
$this->userDefinition,
$request,
$context);
} #[Route(path: '/api/_info/me', name: 'api.change.me', defaults: ['auth_required' => true, '_acl' => ['user_change_me']], methods: ['PATCH'])]
public function updateMe(Context
$context, Request
$request, ResponseFactoryInterface
$responseFactory): Response
{ if (!
$context->
getSource() instanceof AdminApiSource
) { throw new InvalidContextSourceException(AdminApiSource::
class,
$context->
getSource()::
class);
} $userId =
$context->
getSource()->
getUserId();
if (!
$userId) {