LLM OCP API: Fix security issue

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Marcel Klehr 2023-07-06 12:41:42 +02:00
parent 62b19e0675
commit f7e1e79880

View file

@ -85,6 +85,10 @@ class LanguageModelApiController extends \OCP\AppFramework\OCSController {
try {
$task = $this->languageModelManager->getTask($id);
if ($this->userId !== $task->getUserId()) {
return new DataResponse(['message' => $this->l->t('Task not found')], Http::STATUS_NOT_FOUND);
}
return new DataResponse([
'task' => $task,
]);