Ghost/ghost/admin/app/routes/dashboard.js
Peter Zimon 0503ce5f35 Updated Dashboard visibility
- only owner/admins can view Dashboard, everyone else is redirected to "View site"
2021-02-24 15:33:00 +01:00

23 lines
545 B
JavaScript

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');
}
});
}
buildRouteInfoMetadata() {
return {
mainClasses: ['gh-main-wide']
};
}
setupController() {
this.controller.initialise();
}
}