Skip to content

Commit 1025540

Browse files
authored
test(core): cover managed output read permissions (#31166)
1 parent eb9a683 commit 1025540

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

packages/core/test/permission.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,21 @@ describe("PermissionV2", () => {
161161
}),
162162
)
163163

164+
it.effect("allows managed output reads without granting external directory access", () =>
165+
Effect.gen(function* () {
166+
yield* setup([
167+
{ action: "*", resource: "*", effect: "deny" },
168+
{ action: "read", resource: "*", effect: "allow" },
169+
])
170+
const service = yield* PermissionV2.Service
171+
172+
expect(yield* service.ask(assertion({ resources: ["tool_123"] }))).toMatchObject({ effect: "allow" })
173+
expect(
174+
yield* service.ask(assertion({ action: "external_directory", resources: ["/tmp/tool-output/*"] })),
175+
).toMatchObject({ effect: "deny" })
176+
}),
177+
)
178+
164179
it.effect("uses build permissions when the Session agent is omitted", () =>
165180
Effect.gen(function* () {
166181
yield* setup()

0 commit comments

Comments
 (0)