fix: harden permissions matching and alias caching (#1027)

This commit is contained in:
Charles Packer
2026-02-18 19:49:53 -08:00
committed by GitHub
parent 92d2955035
commit dc25ce5573
18 changed files with 472 additions and 127 deletions

View File

@@ -17,6 +17,7 @@ type Props = {
approveAlwaysText?: string;
allowPersistence?: boolean;
showPreview?: boolean;
defaultScope?: "project" | "session";
};
// Horizontal line character for Claude Code style
@@ -58,6 +59,7 @@ export const InlineGenericApproval = memo(
approveAlwaysText,
allowPersistence = true,
showPreview = true,
defaultScope = "project",
}: Props) => {
const [selectedOption, setSelectedOption] = useState(0);
const {
@@ -121,7 +123,7 @@ export const InlineGenericApproval = memo(
if (selectedOption === 0) {
onApprove();
} else if (selectedOption === 1 && allowPersistence) {
onApproveAlways("project");
onApproveAlways(defaultScope);
}
return;
}
@@ -136,7 +138,7 @@ export const InlineGenericApproval = memo(
return;
}
if (input === "2" && allowPersistence) {
onApproveAlways("project");
onApproveAlways(defaultScope);
return;
}
},