mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 16:01:40 +03:00
8502ebb96a
refs: https://github.com/TryGhost/Team/issues/1631 Co-authored-by: James Morris <moreofmorris@users.noreply.github.com>
29 lines
766 B
JavaScript
29 lines
766 B
JavaScript
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
|
|
export default class DashboardRoute extends AuthenticatedRoute {
|
|
async 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']
|
|
};
|
|
}
|
|
|
|
// trigger a background load of members plus labels for filter dropdown
|
|
setupController() {
|
|
super.setupController(...arguments);
|
|
}
|
|
|
|
model() {
|
|
return this.controllerFor('dashboard').loadSiteStatusTask.perform();
|
|
}
|
|
}
|