mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-07 03:22:21 +03:00
0503ce5f35
- only owner/admins can view Dashboard, everyone else is redirected to "View site"
23 lines
545 B
JavaScript
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();
|
|
}
|
|
}
|