(core) Add getAclResources method for making all tables/columns available when editing ACL rules

Summary:
The goal is that those who can edit ACL rules can create or change rules for
any resource, even if the rules block their own ability to see the resource.

Test Plan: Added a browser test, and a server test for who can call the new method.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D2703
This commit is contained in:
Dmitry S
2021-01-14 11:10:42 -05:00
parent ffe4a34335
commit d8e742aa0d
6 changed files with 50 additions and 19 deletions

View File

@@ -227,4 +227,11 @@ export interface ActiveDocAPI {
* Check if an ACL formula is valid. If not, will throw an error with an explanation.
*/
checkAclFormula(text: string): Promise<void>;
/**
* Returns the full set of tableIds, with the list of colIds for each table. This is intended
* for editing ACLs. It is only available to users who can edit ACLs, and lists all resources
* regardless of rules that may block access to them.
*/
getAclResources(): Promise<{[tableId: string]: string[]}>;
}