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 10 commits into
Conversation
Codecov Report❌ Patch coverage is Please upload reports for the commit d7d788a to get more accurate results. Additional details and impacted files@@ Coverage Diff @@
## develop #4849 +/- ##
===========================================
+ Coverage 49.34% 51.30% +1.95%
===========================================
Files 646 611 -35
Lines 22851 21202 -1649
Branches 3502 3408 -94
===========================================
- Hits 11276 10877 -399
+ Misses 10529 9309 -1220
+ Partials 1046 1016 -30
... and 220 files with indirect coverage changes 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
|



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.