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 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…
Reference in New Issue
Block a user