core: fix permission rule matching to use permission field instead of pattern field

This commit is contained in:
Dax Raad
2026-01-05 01:21:45 -05:00
parent 035baa4b38
commit 2f5b2b23d5
2 changed files with 5 additions and 5 deletions

View File

@@ -232,7 +232,7 @@ export namespace PermissionNext {
const result = new Set<string>()
for (const tool of tools) {
const permission = EDIT_TOOLS.includes(tool) ? "edit" : tool
const rule = ruleset.findLast((r) => Wildcard.match(permission, r.pattern))
const rule = ruleset.findLast((r) => Wildcard.match(permission, r.permission))
if (!rule) continue
if (rule.pattern === "*" && rule.action === "deny") result.add(tool)
}