Page MenuHomePhabricator

[lib] Move `getRolePermissionBlobs` to `lib`
ClosedPublic

Authored by atul on Apr 23 2023, 3:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Aug 8, 9:32 AM
Unknown Object (File)
Aug 3 2024, 4:06 AM
Unknown Object (File)
Aug 1 2024, 6:11 AM
Unknown Object (File)
Jul 17 2024, 4:58 AM
Unknown Object (File)
Jul 16 2024, 5:29 PM
Unknown Object (File)
Jul 16 2024, 10:21 AM
Unknown Object (File)
Jul 16 2024, 10:21 AM
Unknown Object (File)
Jul 16 2024, 10:21 AM
Subscribers

Details

Summary

We're going to use getRolePermissionBlobs to calculate thread permissions on the client "from first principles" (ie based on threadTypes and getRolePermissionBlobs without needing roles/permissions from the keyserver).

This diff just moves getRolePermissionBlobs to lib so we can use it from native.

Test Plan

This should be a super straightforward drag and drop diff.

However, since it's consumed by updateRolesAndPermissionsForAllThreads I kicked off a updateRolesAndPermissionsForAllThreads migration on keyserver and made sure that roles/permissions continued to be calculated as expected... though it would be very surprising if it didn't.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

keyserver/src/updaters/role-updaters.js
63–67 ↗(On Diff #25578)

All these SQL changes were automatic... I'll go through them all rn.

atul published this revision for review.Apr 23 2023, 3:15 PM
ashoat added inline comments.
keyserver/src/creators/role-creator.js
4 ↗(On Diff #25579)
13 ↗(On Diff #25579)

Not sure why you added a space here

keyserver/src/updaters/role-updaters.js
66 ↗(On Diff #25579)

Can you align this consistently with how it's done in the rest of the codebase?

keyserver/src/updaters/thread-updaters.js
171 ↗(On Diff #25579)

Please undo this change

This revision is now accepted and ready to land.Apr 23 2023, 4:23 PM
keyserver/src/creators/role-creator.js
13 ↗(On Diff #25579)

Ah yeah I was messing with my editor settings to try to get format on save for sql queries, but I ended up adding some random code style fixes as well. Will update this diff to exclude all those extraneous changes.

This revision was automatically updated to reflect the committed changes.