gristlabs_grist-core/test/server
Alex Hall 887717bb15 (core) Decode cell values to prevent working around rule using 'in' on lists
Summary:
Fixes bug described in https://grist.slack.com/archives/C069RUP71/p1699643458649019

Decodes cell values obtained from `InfoView.get` when evaluating user-defined ACL formulas, i.e. the result of `rec.foo` in such a formula. In particular this is so that `rec.some_list` loses the leading `L` type code and behaves sensibly in an expression like `thing in rec.some_list`.

`InfoView.get` is called in many places, but for every usage I found other than here, leaving the cell values encoded was best.

Test Plan: Added two unit server tests. The first is for the main bug involving lists. The second checks the only other plausible way I could think of that this change affects behaviour, and it seems to be for the better since both tests failed before. Most operations involving non-primitive cell values don't do anything sensible with or without decoding, so behaviour shouldn't change meaningfully in those cases.

Reviewers: georgegevoian, paulfitz

Reviewed By: georgegevoian, paulfitz

Subscribers: paulfitz

Differential Revision: https://phab.getgrist.com/D4123
2023-12-04 23:34:08 +02:00
..
lib (core) Decode cell values to prevent working around rule using 'in' on lists 2023-12-04 23:34:08 +02:00
utils (core) sanitizing redis errors 2023-06-06 10:51:17 +02:00
Comm.ts (core) Exit more cleanly on unhandled errors, and handle errors writing to Clients. 2023-12-01 09:42:00 -05:00
customUtil.ts (core) Update dependencies 2023-10-11 17:36:58 -04:00
docTools.ts (core) Porting the AI evaluation script 2023-03-15 14:54:28 +01:00
generateInitialDocSql.ts update comment 2023-01-17 15:59:09 -05:00
gristClient.ts (core) control the distribution of attachment metadata 2022-12-22 09:10:30 -05:00
tcpForwarder.ts (core) Add options to /status health-check endpoints to check DB and Redis liveness. 2023-10-02 14:41:04 -04:00
testUtils.ts (core) Remove transform columns on shutdown 2023-11-14 22:31:34 +02:00
wait.ts (core) Add timeouts to prevent ActiveDoc bad state during shutdown. 2023-09-26 15:32:49 -04:00