mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 09:22:49 +03:00
dc9c812d9c
issue https://github.com/TryGhost/Team/issues/857 - The goal is to avoid testing for the owner role only is cases where we should be testing for the owner or admin role - `isOwner` => `isOwnerOnly` - `isAdmin` => `isAdminOnly` - `isOwnerOrAdmin` => `isAdmin` (concerns now both Owner and Admins)
21 lines
477 B
JavaScript
21 lines
477 B
JavaScript
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
|
|
export default class DashboardRoute extends AuthenticatedRoute {
|
|
beforeModel() {
|
|
super.beforeModel(...arguments);
|
|
if (!this.session.user.isAdmin) {
|
|
return this.transitionTo('site');
|
|
}
|
|
}
|
|
|
|
buildRouteInfoMetadata() {
|
|
return {
|
|
mainClasses: ['gh-main-wide']
|
|
};
|
|
}
|
|
|
|
setupController() {
|
|
this.controller.initialise();
|
|
}
|
|
}
|