(core) Use GristObjCode in CellValue

Summary: Makes type checking a bit stronger

Test Plan: it just has to compile

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D3065
This commit is contained in:
Alex Hall
2021-10-07 23:02:51 +02:00
parent 62db263d1f
commit a64fb105e3
9 changed files with 58 additions and 49 deletions

View File

@@ -19,6 +19,7 @@ import { getSetMapValue, isObject, pruneArray } from 'app/common/gutil';
import { canEdit, canView, isValidRole, Role } from 'app/common/roles';
import { FullUser, UserAccessData } from 'app/common/UserAPI';
import { HomeDBManager } from 'app/gen-server/lib/HomeDBManager';
import { GristObjCode } from 'app/plugin/GristData';
import { compileAclFormula } from 'app/server/lib/ACLFormula';
import { DocClients } from 'app/server/lib/DocClients';
import { getDocSessionAccess, getDocSessionUser, OptDocSession } from 'app/server/lib/DocSession';
@@ -1104,9 +1105,9 @@ export class GranularAccess implements GranularAccessForBundle {
if (colValues === undefined) {
censorAt = () => 1;
} else if (Array.isArray(action[2])) {
censorAt = (colId, idx) => (copyOnNeed() as BulkColValues)[colId][idx] = ['C']; // censored
censorAt = (colId, idx) => (copyOnNeed() as BulkColValues)[colId][idx] = [GristObjCode.Censored];
} else {
censorAt = (colId) => (copyOnNeed() as ColValues)[colId] = ['C']; // censored
censorAt = (colId) => (copyOnNeed() as ColValues)[colId] = [GristObjCode.Censored];
}
// These map an index of a row in the action to its index in rowsBefore and in rowsAfter.