Ghost/ghost/admin/app/routes/dashboard.js

23 lines
545 B
JavaScript
Raw Normal View History

import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
export default class DashboardRoute extends AuthenticatedRoute {
beforeModel() {
super.beforeModel(...arguments);
return this.session.user.then((user) => {
if (!user.isOwnerOrAdmin) {
return this.transitionTo('site');
}
});
}
2021-02-16 20:12:24 +03:00
buildRouteInfoMetadata() {
return {
mainClasses: ['gh-main-wide']
};
}
setupController() {
this.controller.initialise();
}
}