Skip to content

Commit

Permalink
Fixed: Corrected security permissions to allow all the positive actio…
Browse files Browse the repository at this point in the history
…ns without COMMON_ADMIN permission. Imposed security check only on Reject Order button.
  • Loading branch information
ravilodhi committed Oct 19, 2023
1 parent 741ffb8 commit 7522f35
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/authorization/Actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
'APP_ORDER_UPDATE': 'APP_ORDER_UPDATE',
'APP_REJECT_ORDER': 'APP_REJECT_ORDER',
'APP_RF_CONFIG_UPDATE': 'APP_RF_CONFIG_UPDATE',
}
7 changes: 5 additions & 2 deletions src/authorization/Rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ export default {
"APP_CATALOG_VIEW": "",
"APP_ORDER_DETAIL_VIEW": "",
"APP_PRODUCT_DETAIL_VIEW": "",
"APP_ORDER_UPDATE": "COMMON_ADMIN",
"APP_RF_CONFIG_UPDATE": "COMMON_ADMIN"
"APP_REJECT_ORDER": "COMMON_ADMIN",
"APP_ORDER_UPDATE": "",
"APP_RF_CONFIG_UPDATE": "COMMON_ADMIN",
"APP_PARTIAL_ORDER_REJECTION_CONFIG_UPDATE": "COMMON_ADMIN",
"APP_STOREFULFILLMENT_ADMIN": "STOREFULFILLMENT_ADMIN"
} as any
4 changes: 2 additions & 2 deletions src/views/OrderDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
<ion-icon :icon="sendOutline" slot="end" />
</ion-button> -->

<ion-button :disabled="!hasPermission(Actions.APP_ORDER_UPDATE)" expand="block" color="danger" fill="outline" @click="updateOrder(order)">
{{ $t("Reject Order") }}
<ion-button :disabled="!hasPermission(Actions.APP_REJECT_ORDER)" expand="block" color="danger" fill="outline" @click="updateOrder(order)">
{{ translate("Reject Order") }}
</ion-button>
</main>
</ion-content>
Expand Down

0 comments on commit 7522f35

Please sign in to comment.