From 99a92ca69e1e9b3ca75ed333fdc2ed39b069c0d5 Mon Sep 17 00:00:00 2001 From: Oleksandr Hladchenko1 Date: Tue, 24 Oct 2023 12:47:33 +0300 Subject: [PATCH] UIIN-2452: Change permissions to view/create holdings and items --- src/Instance/HoldingsList/HoldingsListContainer.js | 4 ++-- src/Instance/InstanceDetails/InstanceDetails.js | 2 +- .../MemberTenantHoldings/MemberTenantHoldings.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Instance/HoldingsList/HoldingsListContainer.js b/src/Instance/HoldingsList/HoldingsListContainer.js index d5fbbee03..4924fca34 100644 --- a/src/Instance/HoldingsList/HoldingsListContainer.js +++ b/src/Instance/HoldingsList/HoldingsListContainer.js @@ -18,9 +18,9 @@ const HoldingsListContainer = ({ const stripes = useStripes(); const { holdingsRecords: holdings, isLoading } = useInstanceHoldingsQuery(instance.id, { tenantId }); - const canViewHoldings = stripes.hasPerm('ui-inventory.instance.view'); + const canViewHoldings = stripes.hasPerm('ui-inventory.holdings.create'); const canCreateItem = stripes.hasPerm('ui-inventory.item.edit'); - const canViewItems = stripes.hasPerm('ui-inventory.instance.view'); + const canViewItems = stripes.hasPerm('ui-inventory.item.create'); if (isLoading) return ; diff --git a/src/Instance/InstanceDetails/InstanceDetails.js b/src/Instance/InstanceDetails/InstanceDetails.js index b903fc236..08833cacd 100644 --- a/src/Instance/InstanceDetails/InstanceDetails.js +++ b/src/Instance/InstanceDetails/InstanceDetails.js @@ -88,7 +88,7 @@ const InstanceDetails = forwardRef(({ const tags = instance?.tags?.tagList; const isUserInCentralTenant = checkIfUserInCentralTenant(stripes); - const canCreateHoldings = stripes.hasPerm('ui-inventory.holdings.edit'); + const canCreateHoldings = stripes.hasPerm('ui-inventory.holdings.create'); const detailsLastMenu = useMemo(() => { return ( diff --git a/src/Instance/InstanceDetails/MemberTenantHoldings/MemberTenantHoldings.js b/src/Instance/InstanceDetails/MemberTenantHoldings/MemberTenantHoldings.js index 347164e0f..7b7d8e10a 100644 --- a/src/Instance/InstanceDetails/MemberTenantHoldings/MemberTenantHoldings.js +++ b/src/Instance/InstanceDetails/MemberTenantHoldings/MemberTenantHoldings.js @@ -40,10 +40,10 @@ const MemberTenantHoldings = ({ const { holdingsRecords, isLoading } = useInstanceHoldingsQuery(instance?.id, { tenantId: id }); const isUserInCentralTenant = checkIfUserInCentralTenant(stripes); - const canViewHoldings = hasMemberTenantPermission('ui-inventory.instance.view', id, userTenantPermissions); + const canViewHoldings = hasMemberTenantPermission('ui-inventory.holdings.create', id, userTenantPermissions); const canCreateItem = hasMemberTenantPermission('ui-inventory.item.edit', id, userTenantPermissions); const canCreateHoldings = hasMemberTenantPermission('ui-inventory.holdings.edit', id, userTenantPermissions); - const canViewItems = hasMemberTenantPermission('ui-inventory.instance.view', id, userTenantPermissions); + const canViewItems = hasMemberTenantPermission('ui-inventory.item.create', id, userTenantPermissions); if (isEmpty(holdingsRecords)) return null;