Rename to checkLinkPermissions and stop log following on revoke

The old name read as an unconditional unsubscribe. Log following has
its own subscription outside SubscriptionController, so check
core.log.follow on permission changes too. Move the per-connection
work into one helper and split the tests into userPermissionsUpdated
and rolesUpdated, checking the account update event is sent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 5.5 committed 2026-10-08 15:21:02 +00:00
1 parent beec2f523a
commit d10da0f5fc
6 files changed
+112 -44

No files matched your search

+4 -4
View File
@@ -552,7 +552,7 @@ describe("lib/subscriptions", function() {
});
});
describe(".unsubscribeUnpermitted()", function() {
describe(".checkLinkPermissions()", function() {
class DenyingUser {
constructor(denied) {
this.denied = denied;
@@ -576,7 +576,7 @@ describe("lib/subscriptions", function() {
});
it("should remove subscriptions with a string permission the user lost", async function() {
subscriptions.unsubscribeUnpermitted(getLink(0), new DenyingUser("StringPermission"));
subscriptions.checkLinkPermissions(getLink(0), new DenyingUser("StringPermission"));
subscriptions.broadcast(new StringPermissionEvent());
await onceConnectorSend(1);
assertNoEvent(0);
@@ -586,7 +586,7 @@ describe("lib/subscriptions", function() {
});
it("should remove subscriptions with a function permission the user lost", async function() {
subscriptions.unsubscribeUnpermitted(getLink(0), new DenyingUser("FunctionPermission"));
subscriptions.checkLinkPermissions(getLink(0), new DenyingUser("FunctionPermission"));
subscriptions.broadcast(new FunctionPermissionEvent());
await onceConnectorSend(1);
assertNoEvent(0);
@@ -596,7 +596,7 @@ describe("lib/subscriptions", function() {
});
it("should keep subscriptions the user still has permission for", async function() {
subscriptions.unsubscribeUnpermitted(getLink(0), new DenyingUser(null));
subscriptions.checkLinkPermissions(getLink(0), new DenyingUser(null));
subscriptions.broadcast(new StringPermissionEvent());
await onceConnectorSend(0);
assertLastEvent(0, StringPermissionEvent);