2023-03-30 17:40:06 +03:00
|
|
|
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);
|
|
|
|
|
|
|
|
// Only allow Owner & Administrator to access this route
|
2023-05-15 22:31:54 +03:00
|
|
|
if (!this.session.user.isAdmin) {
|
2023-03-30 17:40:06 +03:00
|
|
|
return this.transitionTo('home');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|