2021-01-21 12:11:51 +03:00
|
|
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
|
|
|
|
|
|
export default class DashboardRoute extends AuthenticatedRoute {
|
2022-02-01 21:20:19 +03:00
|
|
|
beforeModel() {
|
2021-02-24 17:33:00 +03:00
|
|
|
super.beforeModel(...arguments);
|
2021-08-04 13:22:19 +03:00
|
|
|
|
2022-02-02 12:12:16 +03:00
|
|
|
if (this.session.user.isContributor) {
|
|
|
|
return this.transitionTo('posts');
|
|
|
|
} else 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
|
|
|
}
|