IONOS: fix: do not offer document creation to public share visitors - #14
Merged
bromiesTM merged 1 commit intoAug 4, 2026
Conversation
deab95d added the userCanEdit() gate to this listener, but the guard is skipped when there is no logged-in user: if ($user && !$userCanCreate) { loggedInUser() returns null on a public share link, so $user is null, the early return never happens and all four Collabora creation entries get registered for anonymous visitors. DefaultPublicShareTemplateProvider calls listCreators() when rendering a public share, so this reaches the public share page. Reproduced against the dev instance: with capabilities present and no user session, 4 creators were registered while userCanEdit() reported false. ionos-dev-v30 blocked this in src/public.js by only registering the legacy OCA.Files.NewFileMenu plugin when the current user was in edit_groups - for a guest getCurrentUser() is null, so the menu stayed away. That plugin and src/view/NewFileMenu.js no longer exist in the NC33 line, so restore the same product behaviour where creation entries now come from: gate the anonymous case here as well. Both group checks already report false without a user, so dropping the $user condition is enough. Behaviour for logged-in users is unchanged. Ported from ionos-dev-v30 richdocuments: f1db58f IONOS: fix: for shares allow document creation only for users that can edit
6 tasks
bromiesTM
approved these changes
Aug 4, 2026
bromiesTM
deleted the
mk/fix/HDNEXT-1967-gate-template-creators-for-guests
branch
August 4, 2026 09:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of HDNEXT-1967 — porting features from the v30 release to
ionos-stable33/ionos-dev-v33.Blocks: IONOS-Productivity/nc-server#300 — that PR carries the
apps-external/richdocumentsgitlink bump pointing at this branch's commit, so this needs to merge first.Summary
deab95d3eadded theuserCanEdit()gate toRegisterTemplateFileCreatorListener, but the guard is skipped when there is no logged-in user:loggedInUser()returnsnullon a public share link, so the early return never happens and all four Collabora creation entries get registered for anonymous visitors.DefaultPublicShareTemplateProvidercallslistCreators()when rendering a public share, so this reaches the public share page.Both group checks already report
falsewithout a user, so dropping the$user &&condition is enough. Behaviour for logged-in users is unchanged.Why this is needed for the v33 line
ionos-dev-v30blocked this insrc/public.jsby only registering the legacyOCA.Files.NewFileMenuplugin when the current user was inedit_groups— for a guestgetCurrentUser()isnull, so the menu stayed away:That plugin and
src/view/NewFileMenu.jsno longer exist in the NC33 line, so the same product behaviour is restored where creation entries now come from.How it was verified
Reproduced against the dev instance before fixing — with capabilities present and no user session, 4 creators were registered while
userCanEdit()reportedfalse.testHandleDoesNotRegisterForPublicShareVisitor— confirmed it fails without the one-line fix (not a vacuous test) and passes with it89 tests, 208 assertionsChecklist