From a4f7f7b3ae1bfbf4ee63c1975093f0e3962daf2b Mon Sep 17 00:00:00 2001 From: Yury Saukou Date: Thu, 31 Aug 2023 14:05:34 +0400 Subject: [PATCH] UIAC-63 Introduce new permission to view all acquisition unit settings --- CHANGELOG.md | 1 + package.json | 18 +++++++++++++----- .../AcquisitionUnitDetails.js | 6 ++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f26ec53..0c270c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## (5.0.0 IN PROGRESS) * *BREAKING* Update `react` to `v18`. Refs UIAC-69. +* Introduce new permission to view all acquisition unit settings. Refs UIAC-63. ## [4.0.0](https://github.com/folio-org/ui-acquisition-units/tree/v4.0.0) (2023-02-22) [Full Changelog](https://github.com/folio-org/ui-acquisition-units/compare/v3.3.1...v4.0.0) diff --git a/package.json b/package.json index 6a4b50e..1bf18f4 100644 --- a/package.json +++ b/package.json @@ -114,17 +114,25 @@ "visible": false }, { - "permissionName": "ui-acquisition-units.settings.userAssignments", - "displayName": "Settings (acquisition units): Manage acquisition unit user assignments", + "permissionName": "ui-acquisition-units.settings.view", + "displayName": "Settings (acquisition units): View acquisition units", "subPermissions": [ "settings.acquisition-units.enabled", - "users.collection.get", - "usergroups.collection.get", "acquisitions-units.units.collection.get", "acquisitions-units.units.item.get", "acquisitions-units.memberships.collection.get", - "acquisitions-units.memberships.item.post", "acquisitions-units.memberships.item.get", + "users.collection.get", + "usergroups.collection.get" + ], + "visible": true + }, + { + "permissionName": "ui-acquisition-units.settings.userAssignments", + "displayName": "Settings (acquisition units): Manage acquisition unit user assignments", + "subPermissions": [ + "ui-acquisition-units.settings.view", + "acquisitions-units.memberships.item.post", "acquisitions-units.memberships.item.delete" ], "visible": true diff --git a/src/settings/AcquisitionUnits/AcquisitionUnitDetails/AcquisitionUnitDetails.js b/src/settings/AcquisitionUnits/AcquisitionUnitDetails/AcquisitionUnitDetails.js index 117cb86..b00e2c9 100644 --- a/src/settings/AcquisitionUnits/AcquisitionUnitDetails/AcquisitionUnitDetails.js +++ b/src/settings/AcquisitionUnits/AcquisitionUnitDetails/AcquisitionUnitDetails.js @@ -37,13 +37,15 @@ const AcquisitionUnitDetails = ({ acquisitionUnit, close, getEditPath, deleteUni const stripes = useStripes(); const getActionMenu = () => { - return ( + const isPermittedToViewActions = stripes.hasPerm('acquisitions-units.units.item.put') || stripes.hasPerm('acquisitions-units.units.item.delete'); + + return isPermittedToViewActions ? ( - ); + ) : null; }; const shortcuts = [