fix(federation): Handle permission mismatches for reaction permissions#16948
Open
fix(federation): Handle permission mismatches for reaction permissions#16948
Conversation
This fixes issues when federated instances are at different versions and have different permission bits (e.g., one has REACT permission from migration, other doesn't yet). Changes: - Skip local permission checks for federated conversations in middleware, as the host server will validate permissions authoritatively when the request is proxied - Add permission healing on federated room join: sync local permissions with host's authoritative permissions to handle version mismatches Fixes: #16902 Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
e1c9316 to
18dfa71
Compare
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.
Summary
This PR fixes issues when federated instances are at different versions and have different permission bits (e.g., one instance has the new
REACTpermission from the migration, while the other doesn't yet).Problem
When the reaction permission feature is deployed across federated Nextcloud instances at different version levels:
Your instance (v34) updates before host (v33): Local permissions include
PERMISSIONS_REACTdue to migration, but host doesn't understand it. The middleware permission check fails locally even though the host would accept the request.Host updates after you: The host's migration adds REACT permission to federated attendees, but the remote participant's local copy doesn't get updated (migrations don't trigger federation notifications).
Host updates before you: Your migration might accidentally grant REACT permission that a moderator had intentionally restricted.
Solution
Skip local permission checks for federated conversations: Since requests are proxied to the host server anyway, the host validates permissions authoritatively. This prevents false negatives from version mismatches.
Add permission healing on federated room join: When a user joins a federated room, sync local permissions with the host's authoritative permissions. This ensures permissions stay in sync across version differences.
Test plan
Fixes: #16902