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