(core) streamline mixedColumns case of granular access control

Summary:
This removes some unintentional repetition of work when there are
no row-level rules (there was a missing `return`).

Test Plan: existing tests pass

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D2782
pull/18/head
Paul Fitzpatrick 3 years ago
parent 65a722501d
commit ee3a8a2b85

@ -1332,13 +1332,10 @@ export class GranularAccess implements GranularAccessForBundle {
const tableAccess = permInfo.getTableAccess(tableId);
const access = accessCheck.get(tableAccess);
if (access === 'allow') { return; }
if (access === 'mixedColumns') {
// Somewhat abusing prune method by calling it with an access function that
// throws on denial.
this._pruneColumns(action, permInfo, tableId, accessCheck);
if (access === 'mixed') {
// Deal with row-level access for the mixed condition.
await this._checkRows(cursor, accessCheck);
}
// The remainder is the mixed condition.
await this._checkRows(cursor, accessCheck);
// Somewhat abusing prune method by calling it with an access function that
// throws on denial.
this._pruneColumns(action, permInfo, tableId, accessCheck);

Loading…
Cancel
Save