1
0
Fork 0
mirror of synced 2024-09-20 11:27:56 +12:00

Bypass view

This commit is contained in:
Adria Navarro 2024-08-07 12:36:51 +02:00
parent c5f504d724
commit 8191552352

View file

@ -1485,6 +1485,43 @@ describe.each([
}
)
})
it("cannot bypass a view filter", async () => {
await config.api.row.save(table._id!, {
one: "foo",
two: "bar",
})
await config.api.row.save(table._id!, {
one: "foo2",
two: "bar2",
})
const view = await config.api.viewV2.create({
tableId: table._id!,
name: generator.guid(),
query: [
{
operator: BasicOperator.EQUAL,
field: "two",
value: "bar2",
},
],
schema: {
id: { visible: true },
one: { visible: false },
two: { visible: true },
},
})
const response = await config.api.viewV2.search(view.id, {
query: {
equal: {
two: "bar",
},
},
})
expect(response.rows).toHaveLength(0)
})
})
describe("permissions", () => {