0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Updated email role restrictions

no issue.
Only admins and owners should have access to sending emails. Updated relevant templates
to restrict access to emails for non-admins/owners
This commit is contained in:
Peter Zimon 2019-11-26 13:20:49 +01:00
parent 727a38d5d1
commit e866808193
7 changed files with 72 additions and 65 deletions

View file

@ -6,6 +6,7 @@ import {inject as service} from '@ember/service';
export default Component.extend({
ghostPaths: service(),
session: service(),
tagName: 'li',
classNames: ['gh-list-row', 'gh-posts-list-item'],

View file

@ -8,6 +8,7 @@ import {inject as service} from '@ember/service';
export default Component.extend({
feature: service(),
settings: service(),
session: service(),
post: null,
saveType: null,

View file

@ -9,6 +9,7 @@ export default Component.extend({
post: null,
saveType: null,
session: service(),
isClosing: null,
// used to set minDate in datepicker

View file

@ -130,7 +130,7 @@
</button>
{{svg-jar "arrow-right"}}
</li>
{{#if (and this.feature.members (eq this.post.displayName "post"))}}
{{#if (and this.feature.members (eq this.post.displayName "post") this.session.user.isOwnerOrAdmin)}}
<li class="nav-list-item" {{action "showSubview" "email-settings"}} data-test-button="email-settings">
<button type="button">
<b>Email newsletter</b>

View file

@ -43,6 +43,7 @@
</span>
{{/if}}
{{#if this.session.user.isOwnerOrAdmin}}
{{#if (or this.post.email (and this.post.isScheduled this.post.sendEmailWhenPublished))}}
{{#if (eq this.post.email.status "failed")}}
<span data-tooltip="Failed to send post by email" class="gh-content-status-emailed error">
@ -60,6 +61,7 @@
{{/if}}
{{/if}}
{{/if}}
{{/if}}
</div>
{{/link-to}}

View file

@ -27,7 +27,7 @@
</div>
</div>
{{#if this.canSendEmail}}
{{#if (and this.canSendEmail this.session.user.isOwnerOrAdmin)}}
<div class="gh-publishmenu-section">
<div class="gh-publishmenu-radio gh-publishmenu-email">
{{#if this.backgroundLoader.isRunning}}

View file

@ -26,6 +26,7 @@
</div>
</div>
</section>
{{#if this.session.user.isOwnerOrAdmin}}
{{#unless this.post.email}}
<section class="gh-publishmenu-section">
<div class="gh-publishmenu-radio gh-publishmenu-email">
@ -53,4 +54,5 @@
</div>
</section>
{{/unless}}
{{/if}}
</div>