mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add support for special ACL rules, for viewing rules and downloading documents.
Summary: - Use special ACLResources of the form "*SPECIAL:<RuleType>" to represent special document-wide rules. - Include default rules that give Read access to these resources to Owners only. - Add UI with a checkbox to give access to everyone instead. - Allow expanding the UI for advanced configuration. - These rules don't actually have any behavior yet. Test Plan: WIP Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2764
This commit is contained in:
@@ -21,7 +21,8 @@ import { compileAclFormula } from 'app/server/lib/ACLFormula';
|
||||
import { DocClients } from 'app/server/lib/DocClients';
|
||||
import { getDocSessionAccess, getDocSessionUser, OptDocSession } from 'app/server/lib/DocSession';
|
||||
import * as log from 'app/server/lib/log';
|
||||
import { IPermissionInfo, PermissionInfo, PermissionSetWithContext, TablePermissionSetWithContext } from 'app/server/lib/PermissionInfo';
|
||||
import { IPermissionInfo, PermissionInfo, PermissionSetWithContext } from 'app/server/lib/PermissionInfo';
|
||||
import { TablePermissionSetWithContext } from 'app/server/lib/PermissionInfo';
|
||||
import { integerParam } from 'app/server/lib/requestUtils';
|
||||
import { getRelatedRows, getRowIdsFromDocAction } from 'app/server/lib/RowAccess';
|
||||
import cloneDeep = require('lodash/cloneDeep');
|
||||
@@ -135,7 +136,7 @@ export class GranularAccess implements GranularAccessForBundle {
|
||||
// affected rows for the relevant table before and after each DocAction. It
|
||||
// may contain some unaffected rows as well. Other metadata is included if
|
||||
// needed.
|
||||
private _steps: Promise<Array<ActionStep>>|null = null;
|
||||
private _steps: Promise<ActionStep[]>|null = null;
|
||||
// Access control is done sequentially, bundle by bundle. This is the current bundle.
|
||||
private _activeBundle: {
|
||||
docSession: OptDocSession,
|
||||
@@ -173,7 +174,7 @@ export class GranularAccess implements GranularAccessForBundle {
|
||||
* Update granular access from DocData.
|
||||
*/
|
||||
public async update() {
|
||||
this._ruler.update(this._docData);
|
||||
await this._ruler.update(this._docData);
|
||||
|
||||
// Also clear the per-docSession cache of user attributes.
|
||||
this._userAttributesMap = new WeakMap();
|
||||
|
||||
Reference in New Issue
Block a user