mirror of
https://github.com/fleetbase/fleetbase.git
synced 2026-01-08 07:16:49 +00:00
17 lines
481 B
JavaScript
17 lines
481 B
JavaScript
import Route from '@ember/routing/route';
|
|
import { inject as service } from '@ember/service';
|
|
|
|
export default class ConsoleAdminRoute extends Route {
|
|
@service currentUser;
|
|
@service notifications;
|
|
@service router;
|
|
|
|
beforeModel() {
|
|
if (!this.currentUser.isAdmin) {
|
|
return this.router.transitionTo('console').then(() => {
|
|
this.notifications.error('You do not have authorization to access admin!');
|
|
});
|
|
}
|
|
}
|
|
}
|