Made launch wizard only accessible to owners

refs https://github.com/TryGhost/Team/issues/460

- member payment settings are only changeable by owners which would leave the wizard being a single step
- wizard is designed to be used as one of the first things after initial site setup which will be completed as the owner user
This commit is contained in:
Kevin Ansfield 2021-02-04 17:36:29 +00:00
parent 29ae0f734c
commit 6a14087ccc
3 changed files with 21 additions and 2 deletions

View File

@ -0,0 +1,6 @@
import Controller from '@ember/controller';
import {inject as service} from '@ember/service';
export default class DashboardController extends Controller {
@service session;
}

View File

@ -1,3 +1,14 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import {inject as service} from '@ember/service';
export default class LaunchRoute extends AuthenticatedRoute {}
export default class LaunchRoute extends AuthenticatedRoute {
@service session;
beforeModel() {
return this.session.user.then((user) => {
if (!user.isOwner) {
return this.transitionTo('home');
}
});
}
}

View File

@ -6,6 +6,8 @@
</GhCanvasHeader>
<section class="view-container gh-main-width">
<LinkTo @route="launch">Launch site - Finish setup</LinkTo>
{{#if this.session.user.isOwner}}
<LinkTo @route="launch">Launch site - Finish setup</LinkTo>
{{/if}}
</section>
</section>