From b68686fe9c759b8f360558e5457636e91c265ba8 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Tue, 6 Dec 2022 11:06:12 +0000 Subject: [PATCH] Fixed 403 newsletters request for contributors when opening editor closes https://github.com/TryGhost/Team/issues/2242 Contributors don't have permission to fetch `/newsletters/` but the publish flow was sending a request every time a contributor opened a post in the editor creating noise in event logs and in the developer console. - disabled the newsletters fetch when the logged in user is a contributor - contributors can't publish so the "missing" data has no effect on the publish flow as it's not used --- ghost/admin/app/utils/publish-options.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ghost/admin/app/utils/publish-options.js b/ghost/admin/app/utils/publish-options.js index 69f0933258..316379a707 100644 --- a/ghost/admin/app/utils/publish-options.js +++ b/ghost/admin/app/utils/publish-options.js @@ -285,7 +285,9 @@ export default class PublishOptions { promises.push(this._checkPublishingLimit()); // newsletters - promises.push(this.store.query('newsletter', {status: 'active', limit: 'all', include: 'count.members'})); + if (!this.user.isContributor) { + promises.push(this.store.query('newsletter', {status: 'active', limit: 'all', include: 'count.members'})); + } yield Promise.all(promises); }