Page MenuHomePhabricator

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

Authored by atul on Apr 23 2023, 3:13 PM.
Tags
None
Referenced Files
F2714735: D7581.diff
Mon, Sep 16, 2:05 AM
F2709652: D7581.id25587.diff
Sun, Sep 15, 8:29 PM
Unknown Object (File)
Tue, Sep 10, 2:14 PM
Unknown Object (File)
Tue, Sep 10, 2:14 PM
Unknown Object (File)
Tue, Sep 10, 2:14 PM
Unknown Object (File)
Tue, Sep 10, 2:14 PM
Unknown Object (File)
Tue, Sep 10, 2:14 PM
Unknown Object (File)
Tue, Sep 10, 2:12 PM
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
arcpatch-D7581 (branched from 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 ↗(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.