(core) Allow doc owners to view document usage regardless of access rules

Summary: Document usage is now available for owners regardless ACL rules

Test Plan: Updated

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3717
pull/365/head
Jarosław Sadziński 2 years ago
parent 312d2331a8
commit 2ca407505b

@ -628,6 +628,10 @@ export class GranularAccess implements GranularAccessForBundle {
options: {role?: Role | null} = {}
): Promise<FilteredDocUsageSummary> {
const result: FilteredDocUsageSummary = { ...docUsage };
// Owners can see everything all the time.
if (await this.isOwner(docSession)) {
return result;
}
const role = options.role ?? await this.getNominalAccess(docSession);
const hasEditRole = canEdit(role);
if (!hasEditRole) { result.dataLimitStatus = null; }

Loading…
Cancel
Save