Skip to content

fix: Ensure edit permissions are checked before template file token g…#1

Merged
tanyaka merged 2 commits into
mainfrom
fix/respect_edit_groups_for_templates
May 26, 2025
Merged

fix: Ensure edit permissions are checked before template file token g…#1
tanyaka merged 2 commits into
mainfrom
fix/respect_edit_groups_for_templates

Conversation

@printminion-co
Copy link
Copy Markdown

@printminion-co printminion-co commented Apr 25, 2025

…eneration

otherwise file created from template will be editable for user with readonly permissions

wait for nextcloud#4698 to be resolved

  • Resolves: #
  • Target version: main

Summary

TODO

  • ...

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Documentation (manuals or wiki) has been updated or is not required

@printminion-co printminion-co force-pushed the fix/respect_edit_groups_for_templates branch 2 times, most recently from ab063d1 to 46e2fa8 Compare April 25, 2025 10:29
@printminion-co printminion-co force-pushed the fix/respect_edit_groups_for_templates branch 4 times, most recently from 572d57a to 89ff3a7 Compare May 12, 2025 07:40
@github-actions
Copy link
Copy Markdown

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

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.)

@printminion-co printminion-co force-pushed the fix/respect_edit_groups_for_templates branch from 89ff3a7 to 9222570 Compare May 19, 2025 08:15
printminion-co and others added 2 commits May 23, 2025 14:09
…eneration

otherwise file created from template will be editable for user with readonly permissions

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Co-authored-by: Julius Knorr <jus@bitgrid.net>
Signed-off-by: Mikhailo Matiyenko-Kupriyanov <145785698+printminion-co@users.noreply.github.com>
@printminion-co printminion-co force-pushed the fix/respect_edit_groups_for_templates branch from 0aa4ba6 to 7878dd3 Compare May 23, 2025 12:09
@tanyaka tanyaka merged commit 1f483fc into main May 26, 2025
43 of 61 checks passed
@tanyaka tanyaka deleted the fix/respect_edit_groups_for_templates branch May 26, 2025 08:03
printminion-co pushed a commit that referenced this pull request Mar 11, 2026
This fixed the follow warning:

```
json_decode(): Passing null to parameter #1 ($json) of type string is deprecated at /var/www/html/apps-extra/richdocuments/lib/Service/CapabilitiesService.php#142
```

The method `get` return string|null

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
printminion-co pushed a commit that referenced this pull request Mar 11, 2026
This fixed the follow warning:

```
json_decode(): Passing null to parameter #1 ($json) of type string is deprecated at /var/www/html/apps-extra/richdocuments/lib/Service/CapabilitiesService.php#142
```

The method `get` return string|null

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
printminion-co pushed a commit that referenced this pull request May 5, 2026
…nt paths

When shouldSecure() is called with tryOpen=true on a path that does not
exist yet (e.g. a rename target or a files_versions snapshot path), the
underlying fopen() call returns false. Calling fclose(false) on that
value throws a TypeError in PHP 8, which propagates as an uncaught
exception and aborts the entire DAV operation with HTTP 500.

To reproduce: enable Secure View watermarking for a group, add your
user to that group, then rename or overwrite any Office document. The
rename fails immediately with HTTP 500 and the following error appears
in nextcloud.log:

  fclose(): Argument #1 ($stream) must be of type resource, bool given
  in …/richdocuments/lib/Service/SecureViewService.php:37

Signed-off-by: Christoph Schaefer <christoph.schaefer@nextcloud.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
printminion-co pushed a commit that referenced this pull request May 5, 2026
…nt paths

When shouldSecure() is called with tryOpen=true on a path that does not
exist yet (e.g. a rename target or a files_versions snapshot path), the
underlying fopen() call returns false. Calling fclose(false) on that
value throws a TypeError in PHP 8, which propagates as an uncaught
exception and aborts the entire DAV operation with HTTP 500.

To reproduce: enable Secure View watermarking for a group, add your
user to that group, then rename or overwrite any Office document. The
rename fails immediately with HTTP 500 and the following error appears
in nextcloud.log:

  fclose(): Argument #1 ($stream) must be of type resource, bool given
  in …/richdocuments/lib/Service/SecureViewService.php:37

Signed-off-by: Christoph Schaefer <christoph.schaefer@nextcloud.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
printminion-co pushed a commit that referenced this pull request May 5, 2026
…nt paths

When shouldSecure() is called with tryOpen=true on a path that does not
exist yet (e.g. a rename target or a files_versions snapshot path), the
underlying fopen() call returns false. Calling fclose(false) on that
value throws a TypeError in PHP 8, which propagates as an uncaught
exception and aborts the entire DAV operation with HTTP 500.

To reproduce: enable Secure View watermarking for a group, add your
user to that group, then rename or overwrite any Office document. The
rename fails immediately with HTTP 500 and the following error appears
in nextcloud.log:

  fclose(): Argument #1 ($stream) must be of type resource, bool given
  in …/richdocuments/lib/Service/SecureViewService.php:37

Signed-off-by: Christoph Schaefer <christoph.schaefer@nextcloud.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants