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

Fixed billing/update links showing for admins

no issue

- only owners can generate tokens to identify as the publication so the billing app won't work for non-owners
This commit is contained in:
Kevin Ansfield 2021-03-15 09:11:36 +00:00 committed by Daniel Lockyer
parent 74e2d3ef8c
commit efdde1f4a6
2 changed files with 10 additions and 2 deletions

View file

@ -88,7 +88,7 @@
<li><LinkTo @route="staff" data-test-nav="staff">{{svg-jar "staff"}}Staff</LinkTo></li>
</ul>
{{#if (gh-user-can-admin this.session.user)}}
{{#if this.session.user.isOwner}}
<ul class="gh-nav-list">
{{#if this.showBilling}}
<li class="relative">

View file

@ -3,6 +3,7 @@ import {inject as service} from '@ember/service';
export default AuthenticatedRoute.extend({
billing: service(),
session: service(),
queryParams: {
action: {refreshModel: true}
@ -10,7 +11,14 @@ export default AuthenticatedRoute.extend({
beforeModel(transition) {
this._super(...arguments);
this.billing.set('previousTransition', transition);
return this.session.user.then((user) => {
if (!user.isOwner) {
return this.transitionTo('home');
}
this.billing.set('previousTransition', transition);
});
},
model(params) {