feat: Restrict access to upload for Viewers profile (WPB-25257)#4849
feat: Restrict access to upload for Viewers profile (WPB-25257)#4849ohassine wants to merge 6 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #4849 +/- ##
===========================================
+ Coverage 51.26% 51.30% +0.03%
===========================================
Files 611 611
Lines 21181 21202 +21
Branches 3405 3408 +3
===========================================
+ Hits 10859 10877 +18
- Misses 9308 9309 +1
- Partials 1014 1016 +2
Continue to review full report in Codecov by Sentry.
🚀 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?
| 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.
|
|
||
| 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.



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.