mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Fix exports to CSV/XLSX/etc when data is restricted by access rules
Summary: - The issue manifested as error "Cannot read property '0' of undefined" in some cases, and as "Blocked by table read access rules" in others (instead of limiting output to what's not blocked) - Goes deeper: exports weren't respecting metadata censoring. - The fix changes exports to use censored metadata, which addresses both errors above. - Includes an improvement to column ordering in XLSX exports. Test Plan: Add a server test for CSV and XLSX exports with access rules Reviewers: paulfitz, georgegevoian Reviewed By: paulfitz, georgegevoian Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D3615
This commit is contained in:
@@ -2170,6 +2170,13 @@ const dummyAccessCheck: IAccessCheck = {
|
||||
|
||||
/**
|
||||
* Manage censoring metadata.
|
||||
*
|
||||
* For most metadata, censoring means blanking out certain fields, rather than removing rows,
|
||||
* (because the latter was too big of a change). In particular, these changes are relied on by
|
||||
* other code:
|
||||
*
|
||||
* - Censored tables (from _grist_Tables) have cleared tableId field. To check for it, use the
|
||||
* isTableCensored() helper in app/common/isHiddenTable.ts. This is used by exports to Excel.
|
||||
*/
|
||||
export class CensorshipInfo {
|
||||
public censoredTables = new Set<number>();
|
||||
|
||||
Reference in New Issue
Block a user