Skip to content

Commit

Permalink
Improved: added permission check over the product identifier (bopis-443)
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Oct 10, 2024
1 parent f53052d commit d4eb1ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/DxpProductIdentifier.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
{{ 'Choosing a product identifier allows you to view products with your preferred identifiers.' }}
</ion-card-content>

<ion-item>
<ion-item :disabled="!appContext.hasPermission('APP_SETTING_UPDATE')">
<ion-select :label="$t('Primary')" interface="popover" :placeholder="'primary identifier'" :value="productIdentificationPref.primaryId" @ionChange="setProductIdentificationPref($event.detail.value, 'primaryId')">
<ion-select-option v-for="identification in productIdentificationOptions" :key="identification" :value="identification" >{{ identification }}</ion-select-option>
</ion-select>
</ion-item>
<ion-item lines="none">
<ion-item lines="none" :disabled="!appContext.hasPermission('APP_SETTING_UPDATE')">
<ion-select :label="$t('Secondary')" interface="popover" :placeholder="'secondary identifier'" :value="productIdentificationPref.secondaryId" @ionChange="setProductIdentificationPref($event.detail.value, 'secondaryId')">
<ion-select-option v-for="identification in productIdentificationOptions" :key="identification" :value="identification" >{{ identification }}</ion-select-option>
<ion-select-option value="">{{ "None" }}</ion-select-option>
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ export let dxpComponents = {
loginContext.getConfig = options.getConfig
loginContext.initialise = options.initialise

appContext.hasPermission = options.hasPermission

// set a default locale in the state
i18n.global.locale.value = useUserStore().getLocale

Expand Down

0 comments on commit d4eb1ea

Please sign in to comment.