mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 08:31:43 +03:00
18 lines
439 B
JavaScript
18 lines
439 B
JavaScript
|
import AuthenticatedRoute from './authenticated';
|
||
|
import {inject as service} from '@ember/service';
|
||
|
|
||
|
// need this to be authenticated
|
||
|
export default class WebsocketRoute extends AuthenticatedRoute {
|
||
|
@service session;
|
||
|
|
||
|
beforeModel() {
|
||
|
super.beforeModel(...arguments);
|
||
|
|
||
|
const user = this.session.user;
|
||
|
|
||
|
if (!user.isAdmin) {
|
||
|
return this.transitionTo('settings.staff.user', user);
|
||
|
}
|
||
|
}
|
||
|
}
|