-
Notifications
You must be signed in to change notification settings - Fork 511
feat(permissions): Split chat and reaction permissions #16835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
402d395
feat(permissions): Split chat and reaction permissions
luflow 7eaad47
docs: Update API documentation for REACT permission
luflow 3ea09cb
docs: Apply suggestion from @nickvergessen
luflow 0362fbe
feat(capabilities): Add react-permission capability
luflow 70180bb
feat(frontend): Add federation fallback for react permission
luflow b4ccf0f
test(integration): Update expected participantPermissions to 510
luflow 237a0a8
docs: Add react-permission integration guide for clients
luflow 4e17361
feat(capabilities): Expose permissions max values via API
luflow 32329ec
feat(frontend): Add capability-aware permissions UI with API fallback
luflow 4c1b7b3
docs: Document permissions config and improve variable naming
luflow 8f344e4
fix(openapi): Update permissions max value to 511
luflow b9d4b16
fix: correct handling of disabled states if canPostMessages is not al…
luflow bb7dc24
fix: Correct disabled behavior for audio recorder button
luflow a076c11
Merge branch 'main' into feat/split-chat-react-permissions
luflow 8501a4a
fix: Address PR review feedback for permissions feature
luflow 8353c1e
fix(chat): correctly update last message and unread counter from polling
Antreesy 590c11f
fix(l10n): Update translations from Transifex
nextcloud-bot 944549f
fix(bots): Add reactions from bots before relaying the message
nickvergessen 23a0083
test: Skip federation permissions test for older server versions
luflow f902d13
fix(permissions): Regenerate OpenAPI specs and update CapabilitiesTest
luflow 69c0568
fix(permissions): Add permissions to LOCAL_CONFIGS array
luflow a34201b
fix(permissions): Allow empty list in config-local type definition
luflow 0efce34
fix(permissions): Regenerate OpenAPI specs after type change
luflow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # React Permission Integration Guide | ||
|
|
||
| This document describes the changes needed for frontend clients to support the new separate reaction permission introduced in Talk 24 (Nextcloud 34). | ||
|
|
||
| ## Background | ||
|
|
||
| Previously, the CHAT permission (128) controlled both posting messages and adding reactions. This has been split into two separate permissions: | ||
|
|
||
| - **CHAT (128)**: Post messages and share items | ||
| - **REACT (256)**: Add/remove reactions | ||
|
|
||
| ## New Capability | ||
|
|
||
| A new capability `react-permission` indicates server support for the separate reaction permission. | ||
|
|
||
| ``` | ||
| features: [..., "react-permission", ...] | ||
| ``` | ||
|
|
||
| ## Permission Constants | ||
|
|
||
| ``` | ||
| PERMISSIONS_REACT = 256 | ||
| PERMISSIONS_MAX_DEFAULT = 510 // was 254 | ||
| PERMISSIONS_MAX_CUSTOM = 511 // was 255 | ||
| ``` | ||
|
|
||
| ## Implementation | ||
|
|
||
| ### Checking if user can react | ||
|
|
||
| ```javascript | ||
| const hasReactPermissionCapability = capabilities.features.includes('react-permission') | ||
|
|
||
| const permissionToCheck = hasReactPermissionCapability | ||
| ? PERMISSIONS_REACT // 256 | ||
| : PERMISSIONS_CHAT // 128 (fallback for older servers) | ||
|
|
||
| const canReact = (participant.permissions & permissionToCheck) !== 0 | ||
| ``` | ||
|
|
||
| ### Why the fallback is needed | ||
|
|
||
| When federating with older Nextcloud servers or when the desktop client connects to an older server, the `react-permission` capability won't be present. In this case, clients should fall back to checking the CHAT permission, as that's what controlled reactions before this change. | ||
|
|
||
| ## Migration | ||
|
|
||
| The backend migration automatically grants the REACT permission to all users who previously had the CHAT permission, ensuring backward compatibility. | ||
|
|
||
| ## UI Changes | ||
|
|
||
| The permissions editor should show two separate checkboxes: | ||
| - "Can post messages" (CHAT - 128) | ||
| - "Can add reactions" (REACT - 256) | ||
|
|
||
| Instead of the previous combined "Can post messages and reactions" checkbox. | ||
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.