Bypass view
This commit is contained in:
parent
c5f504d724
commit
8191552352
|
@ -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", () => {
|
||||
|
|
Loading…
Reference in New Issue