Skip to content

Commit

Permalink
UIIN-3187: ECS: Disable opening item details if a user is not affilia…
Browse files Browse the repository at this point in the history
…ted with item's member tenant
  • Loading branch information
mariia-aloshyna committed Jan 9, 2025
1 parent 8657bbe commit 02cc133
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions src/components/InstancesList/InstancesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
stripesConnect,
withNamespace,
checkIfUserInCentralTenant,
checkIfUserInMemberTenant,
TitleManager,
} from '@folio/stripes/core';
import {
Expand Down Expand Up @@ -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({
Expand Down

0 comments on commit 02cc133

Please sign in to comment.