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)
Tue, Nov 5, 2:10 AM
Unknown Object (File)
Oct 3 2024, 5:42 AM
Unknown Object (File)
Oct 2 2024, 2:27 PM
Unknown Object (File)
Sep 18 2024, 4:37 PM
Unknown Object (File)
Sep 18 2024, 4:35 PM
Unknown Object (File)
Sep 18 2024, 4:09 PM
Unknown Object (File)
Sep 18 2024, 4:06 PM
Unknown Object (File)
Sep 16 2024, 7:06 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
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

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
13

Not sure why you added a space here

keyserver/src/updaters/role-updaters.js
66

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

keyserver/src/updaters/thread-updaters.js
171

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

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.