[keyserver] Introduce a new thread permission for pinning / unpinning messages
Summary:
We need to introduces new thread permission that limits who is able to manage the pins for a thread. At the moment, this is only granted to Admins, so there's a couple of things that need to be done here:
- Update the baseAdminPriviledges so new chats with admins will have the correct, updated permissions
- Run a migration to cover existing threads
We call updateRolesAndPermissionsForAllThreads() which should handle updating the permissions for each of the threads given the new roles.
The migration was discussed in the Linear task.
Depends on D7199
Test Plan:
- Confirm that the migration is successful
- Confirm that the roles table is updated for Admins (expected result is that the query only finds Admins to have the new permissions)
- Confirm that the memberships table for each of the threads is updated (expected result is that the query finds the permissions to be NOT NULL in each thread for user 256, the admin user locally)
Reviewers: atul, ginsu, tomek, ashoat
Reviewed By: ashoat
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D6928