mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(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
This commit is contained in:
parent
65a722501d
commit
ee3a8a2b85
@ -1332,13 +1332,10 @@ export class GranularAccess implements GranularAccessForBundle {
|
|||||||
const tableAccess = permInfo.getTableAccess(tableId);
|
const tableAccess = permInfo.getTableAccess(tableId);
|
||||||
const access = accessCheck.get(tableAccess);
|
const access = accessCheck.get(tableAccess);
|
||||||
if (access === 'allow') { return; }
|
if (access === 'allow') { return; }
|
||||||
if (access === 'mixedColumns') {
|
if (access === 'mixed') {
|
||||||
// Somewhat abusing prune method by calling it with an access function that
|
// Deal with row-level access for the mixed condition.
|
||||||
// throws on denial.
|
|
||||||
this._pruneColumns(action, permInfo, tableId, accessCheck);
|
|
||||||
}
|
|
||||||
// The remainder is the mixed condition.
|
|
||||||
await this._checkRows(cursor, accessCheck);
|
await this._checkRows(cursor, accessCheck);
|
||||||
|
}
|
||||||
// Somewhat abusing prune method by calling it with an access function that
|
// Somewhat abusing prune method by calling it with an access function that
|
||||||
// throws on denial.
|
// throws on denial.
|
||||||
this._pruneColumns(action, permInfo, tableId, accessCheck);
|
this._pruneColumns(action, permInfo, tableId, accessCheck);
|
||||||
|
Loading…
Reference in New Issue
Block a user