Skip to content

Commit

Permalink
Merge pull request #295 from amansinghbais/270-go-to-oms-permission
Browse files Browse the repository at this point in the history
Improved: added a permission for 'Go To OMS' functionality also passed hasPermission method while dxp-component initialization (dxp-270)
  • Loading branch information
ravilodhi authored Oct 14, 2024
2 parents 7f0fb25 + 5f466a0 commit 26a7d27
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 25 deletions.
86 changes: 66 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@casl/ability": "^6.0.0",
"@hotwax/app-version-info": "^1.0.0",
"@hotwax/apps-theme": "^1.2.6",
"@hotwax/dxp-components": "1.13.0",
"@hotwax/dxp-components": "^1.15.4",
"@hotwax/oms-api": "1.14.0",
"@ionic/core": "^7.6.0",
"@ionic/vue": "^7.6.0",
Expand Down
1 change: 1 addition & 0 deletions src/authorization/Actions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export default {
"APP_INV_CNFG_UPDT": "APP_INV_CNFG_UPDT",
"APP_COMMERCE_VIEW": "APP_COMMERCE_VIEW"
}
5 changes: 3 additions & 2 deletions src/authorization/Rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ export default {
"APP_CATALOG_VIEW": "",
"APP_PRDT_DTLS_VIEW": "",
"APP_CTLG_PRDT_DTLS_VIEW": "",
"APP_INV_CNFG_UPDT": "COMMON_ADMIN",
"APP_COMMERCE_VIEW": "COMMERCEUSER_VIEW",
"MERCHANDISING_ADMIN": "MERCHANDISING_ADMIN",
"PREORDER_APP_VIEW": "PREORDER_APP_VIEW"
"PREORDER_APP_VIEW": "PREORDER_APP_VIEW",
"APP_INV_CNFG_UPDT": "COMMON_ADMIN",
} as any
6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import '@ionic/vue/css/display.css';
import './theme/variables.css';
import { dxpComponents } from '@hotwax/dxp-components'
import { login, logout, loader } from './user-utils';
import permissionPlugin from '@/authorization';
import permissionPlugin, { Actions, hasPermission } from '@/authorization';
import permissionRules from '@/authorization/Rules';
import permissionActions from '@/authorization/Actions';
import { getConfig, initialise, setUserTimeZone, getAvailableTimeZones, setUserLocale} from '@/adapter'
Expand All @@ -48,6 +48,7 @@ const app = createApp(App)
actions: permissionActions
})
.use(dxpComponents, {
Actions,
defaultImgUrl: require("@/assets/images/defaultImage.png"),
login,
logout,
Expand All @@ -58,7 +59,8 @@ const app = createApp(App)
localeMessages,
setUserLocale,
setUserTimeZone,
getAvailableTimeZones
getAvailableTimeZones,
hasPermission
});

// Filters are removed in Vue 3 and global filter introduced https://v3.vuejs.org/guide/migration/filters.html#global-filters
Expand Down

0 comments on commit 26a7d27

Please sign in to comment.