0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

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
This commit is contained in:
Kevin Ansfield 2022-12-06 11:06:12 +00:00
parent 58ba154ed7
commit b68686fe9c

View file

@ -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);
}