15 lines
353 B
JavaScript
15 lines
353 B
JavaScript
|
import AuthenticatedRoute from './authenticated';
|
||
|
import {inject as service} from '@ember/service';
|
||
|
|
||
|
export default class AdminRoute extends AuthenticatedRoute {
|
||
|
@service session;
|
||
|
|
||
|
beforeModel() {
|
||
|
super.beforeModel(...arguments);
|
||
|
|
||
|
if (!this.session.user.isAdmin) {
|
||
|
return this.transitionTo('home');
|
||
|
}
|
||
|
}
|
||
|
}
|