diff --git a/web/app/components/document/sidebar.hbs b/web/app/components/document/sidebar.hbs index 21569e3a2..d7ec892f2 100644 --- a/web/app/components/document/sidebar.hbs +++ b/web/app/components/document/sidebar.hbs @@ -289,7 +289,7 @@ @onSave={{perform this.saveApprovers}} @isSaving={{this.saveIsRunning}} @isReadOnly={{this.editingIsDisabled}} - @includeGroupsInPeopleSelect={{true}} + @includeGroupsInPeopleSelect={{this.configSvc.config.group_approvals}} {{! Provide the document to the `has-approved-doc` helper }} @document={{@document}} /> @@ -767,7 +767,7 @@ r); - - const allowed = resp?.headers.get("allowed"); - - if (allowed?.includes("POST")) { - viewerIsGroupApprover = true; + if (this.configSvc.config.group_approvals) { + const resp = await this.fetchSvc + .fetch( + `/api/${this.configSvc.config.api_version}/approvals/${params.document_id}`, + { method: "OPTIONS" }, + ) + .then((r) => r); + + const allowed = resp?.headers.get("allowed"); + + if (allowed?.includes("POST")) { + viewerIsGroupApprover = true; + } } const typedDoc = doc as HermesDocument; diff --git a/web/mirage/utils.ts b/web/mirage/utils.ts index 5bd4ed332..128e3a3c6 100644 --- a/web/mirage/utils.ts +++ b/web/mirage/utils.ts @@ -50,6 +50,7 @@ export const TEST_WEB_CONFIG = { google_doc_folders: "", short_link_base_url: TEST_SHORT_LINK_BASE_URL, skip_google_auth: false, + group_approvals: true, google_analytics_tag_id: undefined, support_link_url: TEST_SUPPORT_URL, version: "1.2.3",