(core) Show a clearer message when actions are blocked by ACL rules

Summary:
- This replaces the message "Unexpected Error / Access Denied / Report a problem" with a
  one-line "Blocked by access rules".

Test Plan: Only tested manually

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D2712
This commit is contained in:
Dmitry S
2021-01-22 09:46:27 -05:00
parent 7a91d49ea1
commit 6f9b85fc8c
3 changed files with 8 additions and 7 deletions

View File

@@ -83,7 +83,7 @@ export function reportError(err: Error|string): void {
_notifier.createUserError(message, options);
} else if (err.name === 'NeedUpgradeError') {
_notifier.createUserError(err.message, {actions: ['upgrade'], key: 'NEED_UPGRADE'});
} else if (code === 'AUTH_NO_EDIT') {
} else if (code === 'AUTH_NO_EDIT' || code === 'ACL_DENY') {
_notifier.createUserError(message, {key: code});
} else {
// If we don't recognize it, consider it an application error (bug) that the user should be