feat: Restrict access to upload for Viewers profile (WPB-25257)#4849
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (70.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #4849 +/- ##
========================================
Coverage 48.84% 48.85%
========================================
Files 643 643
Lines 23012 23022 +10
Branches 3519 3519
========================================
+ Hits 11240 11247 +7
- Misses 10727 10730 +3
Partials 1045 1045
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
…ewers-profile' into Restrict-access-to-upload-for-Viewers-profile
…-upload-for-Viewers-profile
| } | ||
| } | ||
|
|
||
| private fun observeAttachmentOptionsAvailability() { |
There was a problem hiding this comment.
I am not aware of this "Viewers profile" feature but it seems like this does not allow uploading to user from other team. This is a clear business logic and must be placed into kalium use case.
| } | ||
| } | ||
|
|
||
| private fun observeAttachmentOptionsAvailability() { |
There was a problem hiding this comment.
If we disable attachment options, should we also disable sharing files into this conversation from other apps?
There was a problem hiding this comment.
it will be next, we will restrict download, copy, move, screenshoots... step by step
| onDrawingModeClicked = openDrawingCanvas, | ||
| isFileSharingEnabled = messageComposerViewState.value.isFileSharingEnabled | ||
| onDrawingModeClicked = { | ||
| if (messageComposerViewState.value.areAttachmentOptionsEnabled) { |
There was a problem hiding this comment.
No need for an extra condition here since the button will be disabled when areAttachmentOptionsEnabled == false
| } | ||
| } | ||
|
|
||
| private fun observeAttachmentOptionsAvailability() { |
There was a problem hiding this comment.
I think it will be better to to add a real restriction on the logic level to make sure we do not depend on the enabled/disabled button states.
Enable/disable buttons will only visualize the restriction.
There was a problem hiding this comment.
This real restriction backend must enforce it
|
|
||
| combine( | ||
| observeSelfUser().distinctUntilChanged(), | ||
| observeConversationDetails(conversationId) |
There was a problem hiding this comment.
Observing all conversations details just for reading two fields (wireCell and teamId) is probably an overkill.
Also this may update frequently causing UI updates.
There was a problem hiding this comment.
it's not all conversations, it's one conversation by Id
…-upload-for-Viewers-profile # Conflicts: # app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationCoreViewModelFactory.kt
…ewers-profile' into Restrict-access-to-upload-for-Viewers-profile
…-upload-for-Viewers-profile # Conflicts: # kalium
…ewers-profile' into Restrict-access-to-upload-for-Viewers-profile
|



https://wearezeta.atlassian.net/browse/WPB-25257
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764The PR Description
What's new in this PR?
Issues
Restrict access to upload files for Viewers profile by disabling attachments options
Needs releases with:
Testing
Test Coverage (Optional)
How to Test
Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.
Notes (Optional)
Specify here any other facts that you think are important for this issue.
Attachments (Optional)
Attachments like images, videos, etc. (drag and drop in the text box)
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.