@fleetbase/storefront-engine
Version:
Headless Commerce & Marketplace Extension for Fleetbase
20 lines (17 loc) • 600 B
JavaScript
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
export default class PromotionsPushNotificationsRoute extends Route {
store;
currentUser;
storefront;
intl;
abilities;
hostRouter;
notifications;
beforeModel() {
if (this.abilities.cannot('storefront send push notifications')) {
this.notifications.warning(this.intl.t('common.unauthorized-access'));
return this.hostRouter.transitionTo('console.storefront');
}
}
}