From 02cc1337f37c86a3eca773722c5e1da1908269dc Mon Sep 17 00:00:00 2001 From: Mariia_Aloshyna Date: Thu, 9 Jan 2025 18:28:01 +0200 Subject: [PATCH] UIIN-3187: ECS: Disable opening item details if a user is not affiliated with item's member tenant --- CHANGELOG.md | 1 + src/components/InstancesList/InstancesList.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3990ee6e8..4c0ebb435 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * Add "linked-data 1.0" interface to "optionalOkapiInterfaces". Refs UIIN-3166. * Fix infinite loading animation after cancel edit/duplicate or 'Save & Close' consortial holdings/items. Fixes UIIN-3167. * Remove hover-over text next to "Effective call number" on the Item record detail view. Refs UIIN-3131. +* ECS: Disable opening item details if a user is not affiliated with item's member tenant. Fixes UIIN-3187. ## [12.0.8](https://github.com/folio-org/ui-inventory/tree/v12.0.8) (2024-12-24) [Full Changelog](https://github.com/folio-org/ui-inventory/compare/v12.0.7...v12.0.8) diff --git a/src/components/InstancesList/InstancesList.js b/src/components/InstancesList/InstancesList.js index 7b6768ebc..259b09cdd 100644 --- a/src/components/InstancesList/InstancesList.js +++ b/src/components/InstancesList/InstancesList.js @@ -27,6 +27,7 @@ import { stripesConnect, withNamespace, checkIfUserInCentralTenant, + checkIfUserInMemberTenant, TitleManager, } from '@folio/stripes/core'; import { @@ -1212,6 +1213,12 @@ class InstancesList extends React.Component { } const tenantItemBelongsTo = instance?.items?.[0]?.tenantId || stripes.okapi.tenant; + const isUserAffiliatedWithMemberTenant = checkIfUserInMemberTenant(stripes); + + // if a user is not affiliated with the item's member tenant then item details cannot be open + if (!isUserAffiliatedWithMemberTenant) { + return instance; + } itemsByQuery.reset(); const items = await itemsByQuery.GET({