mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 18:52:05 +03:00
24 lines
579 B
JavaScript
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();
|
|
}
|
|
}
|