mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-31 22:32:28 +00:00
core: fix permission rule matching to use permission field instead of pattern field
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user