HomePhabricator
Diffusion Comm 89c9f7376830

[keyserver] Update usage of threads.default_role in validate-role-permissions.js

Description

[keyserver] Update usage of threads.default_role in validate-role-permissions.js

Summary:
We need to get rid of usages of threads.default_role throughout the codebase so we can eventually drop the column.

This diff handles the usage in validate-role-permissions.js

Existing code: Fetches the default_role for the thread for each role so we can determine what permissions blob the role should have.

Depends on D9977

Addresses part of ENG-5833

Test Plan: Ran the script before and after the changes and logged the results of the query. I put them into a side by side text comparison on https://text-compare.com/, and confirmed that whenever default_role was equal to the roleID, the new is_default field = 1. Otherwise, it is null (casted to 0 during the Boolean conversion).

Reviewers: atul, ginsu, tomek

Reviewed By: tomek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D9978