Skip to content

Commit 9b0bde4

Browse files
committed
fixup! delete submissions
Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
1 parent f6ee9ad commit 9b0bde4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/Controller/ApiController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,10 @@ public function deleteSubmission(int $formId, int $submissionId): DataResponse {
14741474
throw new OCSBadRequestException('Submission doesn\'t belong to given form');
14751475
}
14761476

1477-
if ($this->currentUser->getUID() !== $submission->getUserId()) {
1477+
if (
1478+
!in_array(Constants::PERMISSION_RESULTS, $this->formsService->getPermissions($form))
1479+
&& $this->currentUser->getUID() !== $submission->getUserId()
1480+
) {
14781481
throw new OCSForbiddenException('Can only delete your own submissions');
14791482
}
14801483

0 commit comments

Comments
 (0)