From 60eca365f43bb3169e34b31d7e3afc61962c9287 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 25 Oct 2024 14:41:13 +0530 Subject: [PATCH] Improved: dxp-component version to incorporate permissions check over goToOms button. (dxp-270) --- package-lock.json | 8 ++++---- package.json | 2 +- src/authorization/Actions.ts | 3 ++- src/authorization/Rules.ts | 3 ++- src/main.ts | 6 ++++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9ac33f1..14dbf48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.6", - "@hotwax/dxp-components": "1.15.2", + "@hotwax/dxp-components": "1.15.4", "@hotwax/oms-api": "1.14.0", "@ionic/core": "^7.6.0", "@ionic/vue": "^7.6.0", @@ -2800,9 +2800,9 @@ "integrity": "sha512-zpUjGoY7LBlKeiP0V7tonrmoey8HQ5THQmyixQ+IDtrjmEJNBjynW/Ef3gC0FUNNPuVqxWPZdT5CVgaETLGTwg==" }, "node_modules/@hotwax/dxp-components": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.15.2.tgz", - "integrity": "sha512-0jF1xkRIVrDbJwUaaPwWUhp3cVBpdjgAJO/fOQ4XYjzKb8rYXgw0Xm/qHHUnSeAZW5laMnQrm1KtPZp8szu4dQ==", + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.15.4.tgz", + "integrity": "sha512-dlgexo/QBLnLlPkq1zwfWBIPiVtmZKsRcPcCAwe+eFz9qPwyQORdzKb6YjX1WgtRU72GYMv345eA+HuaSY6H5w==", "dependencies": { "@hotwax/oms-api": "^1.8.1", "@ionic/core": "^7.6.0", diff --git a/package.json b/package.json index 727cabc..701caec 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.6", - "@hotwax/dxp-components": "1.15.2", + "@hotwax/dxp-components": "1.15.4", "@hotwax/oms-api": "1.14.0", "@ionic/core": "^7.6.0", "@ionic/vue": "^7.6.0", diff --git a/src/authorization/Actions.ts b/src/authorization/Actions.ts index b7c25d3..5da068f 100644 --- a/src/authorization/Actions.ts +++ b/src/authorization/Actions.ts @@ -9,5 +9,6 @@ export default { 'APP_PERMISSION_CREATE': 'APP_PERMISSION_CREATE', 'APP_PERMISSION_UPDATE': 'APP_PERMISSION_UPDATE', 'APP_PERMISSION_VIEW': 'APP_PERMISSION_VIEW', - 'APP_USER_CREATE': 'APP_USER_CREATE' + 'APP_USER_CREATE': 'APP_USER_CREATE', + 'APP_COMMERCE_VIEW': 'APP_COMMERCE_VIEW' } \ No newline at end of file diff --git a/src/authorization/Rules.ts b/src/authorization/Rules.ts index 47d073c..0bbcf07 100644 --- a/src/authorization/Rules.ts +++ b/src/authorization/Rules.ts @@ -10,5 +10,6 @@ export default { 'APP_PERMISSION_UPDATE': 'SECURITY_UPDATE OR SECURITY_ADMIN', 'APP_PERMISSION_VIEW': 'SECURITY_VIEW OR SECURITY_ADMIN', 'APP_SUPER_USER': 'WEBTOOLS_VIEW', - 'USERS_APP_VIEW': 'USERS_APP_VIEW' + 'USERS_APP_VIEW': 'USERS_APP_VIEW', + 'APP_COMMERCE_VIEW': 'COMMERCEUSER_VIEW' } as any \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index e2f9463..5c895d1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -27,7 +27,7 @@ import '@hotwax/apps-theme'; import store from './store' -import permissionPlugin from '@/authorization'; +import permissionPlugin, { Actions, hasPermission } from '@/authorization'; import permissionRules from '@/authorization/Rules'; import permissionActions from '@/authorization/Actions'; @@ -52,6 +52,7 @@ const app = createApp(App) level: process.env.VUE_APP_DEFAULT_LOG_LEVEL }) .use(dxpComponents, { + Actions, appLoginUrl: process.env.VUE_APP_LOGIN_URL as string, defaultImgUrl: require("@/assets/images/defaultImage.png"), getConfig, @@ -62,7 +63,8 @@ const app = createApp(App) localeMessages, setUserLocale, setUserTimeZone, - getAvailableTimeZones + getAvailableTimeZones, + hasPermission }); router.isReady().then(() => {