Skip to content

Commit

Permalink
Improved: permission checking logic using the help of Actions (bopis-…
Browse files Browse the repository at this point in the history
…443)
  • Loading branch information
amansinghbais committed Oct 10, 2024
1 parent d4eb1ea commit 0d00821
Show file tree
Hide file tree
Showing 2 changed files with 3 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 :disabled="!appContext.hasPermission('APP_SETTING_UPDATE')">
<ion-item :disabled="!appContext.hasPermission(appContext.Actions.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" :disabled="!appContext.hasPermission('APP_SETTING_UPDATE')">
<ion-item lines="none" :disabled="!appContext.hasPermission(appContext.Actions.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
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export let dxpComponents = {
loginContext.getConfig = options.getConfig
loginContext.initialise = options.initialise

appContext.Actions = options.Actions
appContext.hasPermission = options.hasPermission

// set a default locale in the state
Expand Down

0 comments on commit 0d00821

Please sign in to comment.