(core) Showing censored values as a grey cell

Test Plan: Block read access to column A based on the condition rec.B == 1. Then setting B = 1 in a row makes the cell under A grey.

Reviewers: dsagal

Reviewed By: dsagal

Subscribers: paulfitz, dsagal

Differential Revision: https://phab.getgrist.com/D2828
This commit is contained in:
Alex Hall
2021-06-03 17:01:31 +02:00
parent 2feef7f780
commit 2f3a0e0c7f
5 changed files with 67 additions and 3 deletions

View File

@@ -888,9 +888,9 @@ export class GranularAccess implements GranularAccessForBundle {
if (colValues === undefined) {
censorAt = () => 1;
} else if (Array.isArray(action[2])) {
censorAt = (colId, idx) => (colValues as BulkColValues)[colId][idx] = 'CENSORED'; // TODO Pick a suitable value
censorAt = (colId, idx) => (colValues as BulkColValues)[colId][idx] = ['C']; // censored
} else {
censorAt = (colId) => (colValues as ColValues)[colId] = 'CENSORED'; // TODO Pick a suitable value
censorAt = (colId) => (colValues as ColValues)[colId] = ['C']; // censored
}
// These map an index of a row in the action to its index in rowsBefore and in rowsAfter.