Ghost/ghost/admin/app/routes/dashboard.js
2022-02-02 10:12:16 +01:00

24 lines
579 B
JavaScript

import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
export default class DashboardRoute extends AuthenticatedRoute {
beforeModel() {
super.beforeModel(...arguments);
if (this.session.user.isContributor) {
return this.transitionTo('posts');
} else if (!this.session.user.isAdmin) {
return this.transitionTo('site');
}
}
buildRouteInfoMetadata() {
return {
mainClasses: ['gh-main-wide']
};
}
setupController() {
this.controller.initialise();
}
}