Updated default redirect for contributors

This commit is contained in:
Peter Zimon 2022-02-02 10:12:16 +01:00
parent 87738cb5de
commit b5995419dc
2 changed files with 8 additions and 2 deletions

View File

@ -91,7 +91,11 @@ export default class Main extends Component.extend(ShortcutsMixin) {
if (currentRouteName === 'site') {
getOwner(this).lookup(`route:${currentRouteName}`).refresh();
} else {
this.router.transitionTo('site');
if (this.session.user.isContributor) {
this.router.transitionTo('posts');
} else {
this.router.transitionTo('site');
}
}
}

View File

@ -4,7 +4,9 @@ export default class DashboardRoute extends AuthenticatedRoute {
beforeModel() {
super.beforeModel(...arguments);
if (!this.session.user.isAdmin) {
if (this.session.user.isContributor) {
return this.transitionTo('posts');
} else if (!this.session.user.isAdmin) {
return this.transitionTo('site');
}
}