mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) add buttons to delete bad rules
Summary: When access rules refer to tables and/or columns that no longer exist, offer convenient buttons to remove these rules. It could alternatively be useful to generate errors when deleting tables or columns that are mentioned in access rules, and refuse to do so unless the access rules are updated first. Test Plan: added and updated tests Reviewers: georgegevoian Reviewed By: georgegevoian Subscribers: jarek Differential Revision: https://phab.getgrist.com/D3718
This commit is contained in:
@@ -176,6 +176,26 @@ export interface AclTableDescription {
|
||||
groupByColLabels: string[] | null; // Labels of groupby columns for summary tables, or null.
|
||||
}
|
||||
|
||||
export interface AclResources {
|
||||
tables: {[tableId: string]: AclTableDescription};
|
||||
problems: AclRuleProblem[];
|
||||
}
|
||||
|
||||
export interface AclRuleProblem {
|
||||
tables?: {
|
||||
tableIds: string[],
|
||||
};
|
||||
columns?: {
|
||||
tableId: string,
|
||||
colIds: string[],
|
||||
};
|
||||
userAttributes?: {
|
||||
invalidUAColumns: string[],
|
||||
names: string[],
|
||||
}
|
||||
comment: string;
|
||||
}
|
||||
|
||||
export function getTableTitle(table: AclTableDescription): string {
|
||||
let {title} = table;
|
||||
if (table.groupByColLabels) {
|
||||
@@ -349,7 +369,7 @@ export interface ActiveDocAPI {
|
||||
* 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]: AclTableDescription}>;
|
||||
getAclResources(): Promise<AclResources>;
|
||||
|
||||
/**
|
||||
* Wait for document to finish initializing.
|
||||
|
||||
Reference in New Issue
Block a user