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