From 8ba6a04c6de3d5e5a5a9641fe513908368f33175 Mon Sep 17 00:00:00 2001 From: Dmitriy-Litvinenko Date: Thu, 28 Nov 2024 16:10:25 +0200 Subject: [PATCH] UIU-3288: Update permission after BE permission changes --- CHANGELOG.md | 1 + package.json | 20 ++++++++++---------- src/routes/LoanDetailContainer.js | 2 +- src/routes/LoansListingContainer.js | 2 +- src/views/UserDetail/UserDetail.js | 4 ++-- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a2fb6c6d..0210ea217 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Leverage API supported sorting of columns on pre-registrations records list. Refs UIU-3249. * Add permission to access users-keycloak delete method. Refs UIU-3282. +* Update permission after BE permission changes. Refs UIU-3288. ## [11.0.5](https://github.com/folio-org/ui-users/tree/v11.0.5) (2024-11-20) [Full Changelog](https://github.com/folio-org/ui-users/compare/v11.0.3...v11.0.5) diff --git a/package.json b/package.json index 8e1076029..32a3fc1c1 100644 --- a/package.json +++ b/package.json @@ -605,8 +605,8 @@ "displayName": "Settings (Users): Can view patron blocks conditions", "subPermissions": [ "settings.users.enabled", - "patron-block-conditions.collection.get", - "patron-block-conditions.item.get" + "patron-blocks.patron-block-conditions.collection.get", + "patron-blocks.patron-block-conditions.item.get" ], "visible": false }, @@ -615,7 +615,7 @@ "displayName": "Settings (Users): Can view and edit patron blocks conditions", "subPermissions": [ "ui-users.settings.conditions.view", - "patron-block-conditions.item.put" + "patron-blocks.patron-block-conditions.item.put" ], "visible": true }, @@ -645,8 +645,8 @@ "displayName": "Settings (Users): Can view patron blocks limits", "subPermissions": [ "ui-users.settings.conditions.view", - "patron-block-limits.collection.get", - "patron-block-limits.item.get", + "patron-blocks.patron-block-limits.collection.get", + "patron-blocks.patron-block-limits.item.get", "usergroups.collection.get" ], "visible": false @@ -657,9 +657,9 @@ "subPermissions": [ "ui-users.settings.conditions.edit", "ui-users.settings.limits.view", - "patron-block-limits.item.post", - "patron-block-limits.item.put", - "patron-block-limits.item.delete" + "patron-blocks.patron-block-limits.item.post", + "patron-blocks.patron-block-limits.item.put", + "patron-blocks.patron-block-limits.item.delete" ], "visible": true }, @@ -698,8 +698,8 @@ "ui-users.manual-charge.execute", "ui-users.manual-pay.execute", "ui-users.manual-waive.execute", - "accounts.check-transfer.post", - "accounts.check-refund.post", + "feesfines.accounts.check-transfer.post", + "feesfines.accounts.check-refund.post", "feesfines.accounts.transfer.item.post", "feesfines.accounts-bulk.transfer.item.post", "feesfines.accounts.cancel.item.post", diff --git a/src/routes/LoanDetailContainer.js b/src/routes/LoanDetailContainer.js index ed49551b8..2772fbae1 100644 --- a/src/routes/LoanDetailContainer.js +++ b/src/routes/LoanDetailContainer.js @@ -103,7 +103,7 @@ class LoanDetailContainer extends React.Component { type: 'okapi', records: 'automatedPatronBlocks', path: 'automated-patron-blocks/:{id}?limit=2000', - permissionsRequired: 'automated-patron-blocks.collection.get', + permissionsRequired: 'patron-blocks.automated-patron-blocks.collection.get', }, renew: { fetch: false, diff --git a/src/routes/LoansListingContainer.js b/src/routes/LoansListingContainer.js index 048103072..c58a9c5e8 100644 --- a/src/routes/LoansListingContainer.js +++ b/src/routes/LoansListingContainer.js @@ -84,7 +84,7 @@ class LoansListingContainer extends React.Component { type: 'okapi', records: 'automatedPatronBlocks', path: 'automated-patron-blocks/:{id}?limit=2000', - permissionsRequired: 'automated-patron-blocks.collection.get', + permissionsRequired: 'patron-blocks.automated-patron-blocks.collection.get', }, requests: { type: 'okapi', diff --git a/src/views/UserDetail/UserDetail.js b/src/views/UserDetail/UserDetail.js index a9f6cfdbb..42f6a6284 100644 --- a/src/views/UserDetail/UserDetail.js +++ b/src/views/UserDetail/UserDetail.js @@ -582,7 +582,7 @@ class UserDetail extends React.Component { .GET().catch(() => []) : Promise.resolve([]); const automatedPatronBlocksResolver = stripes.hasInterface('automated-patron-blocks') - && stripes.hasPerm('automated-patron-blocks.collection.get') + && stripes.hasPerm('patron-blocks.automated-patron-blocks.collection.get') ? hasAutomatedPatronBlocks .GET().catch(() => []) : Promise.resolve([]); @@ -645,7 +645,7 @@ class UserDetail extends React.Component { const servicePoints = this.props.getUserServicePoints(); const preferredServicePoint = this.props.getPreferredServicePoint(); const hasPatronBlocks = !!patronBlocks.length; - const hasPatronBlocksPermissions = stripes.hasPerm('automated-patron-blocks.collection.get') || stripes.hasPerm('manualblocks.collection.get'); + const hasPatronBlocksPermissions = stripes.hasPerm('patron-blocks.automated-patron-blocks.collection.get') || stripes.hasPerm('manualblocks.collection.get'); const patronGroup = this.getPatronGroup(user); const requestPreferences = get(resources, 'requestPreferences.records.[0].requestPreferences[0]', {}); const allServicePoints = get(resources, 'servicePoints.records', [{}]);