mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-03 03:55:26 +03:00
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');
|
||
|
}
|
||
|
}
|
||
|
}
|