Fix: Prevent re-requesting approval for already approved files - #399
Conversation
There was a problem hiding this comment.
Hi @Amitdwivedi22,
Thanks for the contribution. Could you sign your commits? There are instructions at https://github.com/nextcloud/approval/pull/399/checks?check_run_id=67481178296
| public function request(int $fileId, int $ruleId, ?string $userId, bool $createShares): array { | ||
| public function request(int $fileId, int $ruleId, ?string $userId, bool $createShares) { | ||
|
|
||
| $state = $this->getApprovalState($fileId, $userId); |
There was a problem hiding this comment.
This check is done before ensuring that the user has access to the file which could leak information.
|
|
||
| $state = $this->getApprovalState($fileId, $userId); | ||
|
|
||
| if ($state['state'] === \OCA\Approval\AppInfo\Application::STATE_APPROVED) { |
There was a problem hiding this comment.
| if ($state['state'] === \OCA\Approval\AppInfo\Application::STATE_APPROVED) { | |
| if ($state['state'] === Application::STATE_APPROVED) { |
| }, | ||
| canRequestApproval() { | ||
| return this.userRules.length > 0 | ||
| return this.userRules.length > 0 && this.state !== states.APPROVED |
There was a problem hiding this comment.
This isn't necessary as it only matters that you can't re-request approval for the same workflow. Some users may have two approval flows they want on the same file.
|
For fixing the php-cs workflow you can run |
|
Hi @Amitdwivedi22, Are you still interested in working on this? |
|
Yes by today I will complete it and raise the pr
…On Tue, Mar 31, 2026, 6:14 PM Lukas Schaefer ***@***.***> wrote:
*lukasdotcom* left a comment (nextcloud/approval#399)
<#399?email_source=notifications&email_token=BEHW66D3O6ZM4234XYEFX534TO4SVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJWGIZTQMJWHE2KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJNLQOJPWG33NNVSW45C7N5YGK3S7MNWGSY3L#issuecomment-4162381694>
Hi @Amitdwivedi22 <https://github.com/Amitdwivedi22>,
Are you still interested in working on this?
—
Reply to this email directly, view it on GitHub
<#399?email_source=notifications&email_token=BEHW66D3O6ZM4234XYEFX534TO4SVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJWGIZTQMJWHE2KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJNLQOJPWG33NNVSW45C7N5YGK3S7MNWGSY3L#issuecomment-4162381694>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BEHW66AKFKJOBBBTGY3TBVD4TO4SVAVCNFSM6AAAAACWVPV75KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCNRSGM4DCNRZGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
0a0368e to
d4255a6
Compare
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Fix: Prevent re-requesting approval for already approved files
Closes #398