Skip to content

Commit 098040d

Browse files
committed
fix: applying same fix to rewriteAuthIfMatches
1 parent 2608c61 commit 098040d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/utils.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,14 @@ function rewriteAuthIfMatches(
163163
): PermissionLevelType {
164164
if (permissionLevel.equals(auth)) {
165165
return PermissionLevel.from({
166-
actor: auth.actor,
166+
actor: permissionLevel.actor,
167+
permission: newPermission,
168+
})
169+
}
170+
// Also rewrite PlaceholderAuth to use the session's actor with the new permission
171+
if (PlaceholderAuth.equals(auth)) {
172+
return PermissionLevel.from({
173+
actor: permissionLevel.actor,
167174
permission: newPermission,
168175
})
169176
}

0 commit comments

Comments
 (0)