From 4c0c5dcac6eb6d2af9c223d85b08116d97218a0d Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Thu, 12 May 2022 12:45:13 +0100 Subject: [PATCH] Allowed Editor and Author roles to see email options when publishing no issue - there are no restrictions on Editor/Author emailing on the API side - removed `user.canEmail` computed property as it's only contributors that don't have publish/email permissions and they aren't shown the publishing flow anyway --- ghost/admin/app/models/user.js | 2 -- ghost/admin/app/utils/publish-options.js | 15 +++++---------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/ghost/admin/app/models/user.js b/ghost/admin/app/models/user.js index 03aca20627..d8b2f22d78 100644 --- a/ghost/admin/app/models/user.js +++ b/ghost/admin/app/models/user.js @@ -54,8 +54,6 @@ export default BaseModel.extend(ValidationEngine, { isAdmin: or('isOwnerOnly', 'isAdminOnly'), isAuthorOrContributor: or('isAuthor', 'isContributor'), - canEmail: or('isAdmin', 'isEditor'), - isLoggedIn: computed('id', 'session.user.id', function () { return this.id === this.get('session.user.id'); }), diff --git a/ghost/admin/app/utils/publish-options.js b/ghost/admin/app/utils/publish-options.js index b9624efc9b..2d7633cd8d 100644 --- a/ghost/admin/app/utils/publish-options.js +++ b/ghost/admin/app/utils/publish-options.js @@ -108,7 +108,7 @@ export default class PublishOptions { // publish type dropdown is not shown at all get emailUnavailable() { - return this.post.isPage || this.post.email || !this.user.canEmail || this.emailDisabledInSettings; + return this.post.isPage || this.post.email || this.emailDisabledInSettings; } // publish type dropdown is shown but email options are disabled @@ -252,15 +252,10 @@ export default class PublishOptions { this.totalMemberCount = 1; } - // only perform limit checks and newsletter fetches if the - // current user is allowed to email, otherwise we can hit API - // permission errors - if (this.user.canEmail) { - // email limits - promises.push(this._checkSendingLimit()); - // newsletters - promises.push(this.store.query('newsletter', {status: 'active', limit: 'all', include: 'count.members'})); - } + // email limits + promises.push(this._checkSendingLimit()); + // newsletters + promises.push(this.store.query('newsletter', {status: 'active', limit: 'all', include: 'count.members'})); yield Promise.all(promises); }