Skip to content

Commit 6492935

Browse files
authored
Merge pull request #399 from Amitdwivedi22/fix/prevent-duplicate-approval
Fix: Prevent re-requesting approval for already approved files
2 parents a0c75da + d4255a6 commit 6492935

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/Service/ApprovalService.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,9 @@ public function request(int $fileId, int $ruleId, ?string $userId, bool $createS
461461
}
462462

463463
if ($this->userIsAuthorizedByRule($userId, $rule, 'requesters')) {
464+
if ($this->tagObjectMapper->haveTag((string)$fileId, 'files', $rule['tagApproved'])) {
465+
return ['error' => $this->l10n->t('Approval has already been granted with this rule for this file')];
466+
}
464467
// only request if it has not yet been requested for this rule
465468
if (!$this->tagObjectMapper->haveTag((string)$fileId, 'files', $rule['tagPending'])) {
466469
if ($createShares) {

0 commit comments

Comments
 (0)