mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
86027fdb6f
Adds the UI for self-serve migrations
22 lines
635 B
JavaScript
22 lines
635 B
JavaScript
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default class MigrateRoute extends AuthenticatedRoute {
|
|
@service feature;
|
|
@service session;
|
|
|
|
beforeModel() {
|
|
super.beforeModel(...arguments);
|
|
|
|
// Redirect to Home is feature not enabled
|
|
if (!this.feature.migrateApp) {
|
|
return this.transitionTo('home');
|
|
}
|
|
|
|
// Only allow Owner & Administrator to access this route
|
|
if (!this.session.user.isAdmin || !this.feature.migrateApp) {
|
|
return this.transitionTo('home');
|
|
}
|
|
}
|
|
}
|