2021-01-21 12:11:51 +03:00
|
|
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
2021-08-04 13:22:19 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
2021-01-21 12:11:51 +03:00
|
|
|
|
|
|
|
export default class DashboardRoute extends AuthenticatedRoute {
|
2021-08-04 13:22:19 +03:00
|
|
|
@service feature;
|
|
|
|
|
2021-02-24 17:33:00 +03:00
|
|
|
beforeModel() {
|
|
|
|
super.beforeModel(...arguments);
|
2021-08-04 13:22:19 +03:00
|
|
|
|
2021-07-12 15:55:56 +03:00
|
|
|
if (!this.session.user.isAdmin) {
|
2021-07-08 16:37:31 +03:00
|
|
|
return this.transitionTo('site');
|
|
|
|
}
|
2021-02-24 17:33:00 +03:00
|
|
|
}
|
|
|
|
|
2021-02-16 20:12:24 +03:00
|
|
|
buildRouteInfoMetadata() {
|
|
|
|
return {
|
|
|
|
mainClasses: ['gh-main-wide']
|
|
|
|
};
|
|
|
|
}
|
2021-02-23 17:34:13 +03:00
|
|
|
|
|
|
|
setupController() {
|
|
|
|
this.controller.initialise();
|
|
|
|
}
|
2021-01-21 12:11:51 +03:00
|
|
|
}
|