Page MenuHomePhabricator

[lib] Block user from writing in sidebars
ClosedPublic

Authored by michal on Oct 3 2022, 6:58 AM.
Tags
None
Referenced Files
F2128694: D5284.diff
Thu, Jun 27, 11:09 AM
Unknown Object (File)
Wed, Jun 26, 6:16 AM
Unknown Object (File)
Wed, Jun 19, 1:07 PM
Unknown Object (File)
Wed, Jun 19, 1:03 PM
Unknown Object (File)
Mon, Jun 17, 2:50 AM
Unknown Object (File)
Mon, Jun 17, 2:50 AM
Unknown Object (File)
Mon, Jun 17, 2:50 AM
Unknown Object (File)
Mon, Jun 17, 2:50 AM
Subscribers

Details

Summary

ENG-38
This diff fixes the issue where blocked user could still write in the previously created sidebars.

Test Plan

Tested between an emulator and web:

  1. Create a personal 1-1 chat with other user, block the other user -> neither user can write nor edit properties of the chat and it's sidebars
  2. Create a personal 1-1 chat with admin, block admin -> both user can still write and edit
  3. Create a chat with 3 users, block one -> all users can still write
    • then remove the unblocked user -> neither user can write nor edit

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

michal requested review of this revision.Oct 3 2022, 7:08 AM

This solution makes sense to me. The last diff to touch this code was D1904, and there I said:

This change only solves the issue for PERSONAL threads. To solve it for all one-on-one threads, I could revise the logic to filter non-member out of the threadInfo.members checks performed by threadOrParentThreadIsGroupChat and threadOrParentThreadHasAdminRole. The downside of that approach is that it would be less readable, and in an ideal world the hack won't be necessary for too long. I could be easily convinced to switch to it, though.

This diff seems to implement that solution.

This revision is now accepted and ready to land.Oct 3 2022, 9:55 AM