From e140f2df6d9485c09968384a8cf8749ee091f11c Mon Sep 17 00:00:00 2001 From: Martin Rohrmeier Date: Wed, 12 Jun 2024 15:12:58 +0200 Subject: [PATCH 01/26] feat(access): allow client id with role checks --- CHANGELOG.md | 1 + index.html | 2 +- .../CompanyCertificateDetails/index.tsx | 4 +- .../AdminCredentialElements.tsx | 4 +- .../components/AppDetailHeader/index.tsx | 31 ++-- .../components/AppListGroupView/index.tsx | 2 +- .../AppSubscriptionDetailOverlay/index.tsx | 4 +- .../components/AppUserDetailsTable/index.tsx | 6 +- .../CompanyCertificateCard.tsx | 6 +- .../pages/CompanyCertificates/index.tsx | 4 +- .../EdcConnector/ConnectorDetailsOverlay.tsx | 6 +- .../pages/Home/components/MenuInfo/index.tsx | 2 +- .../Organization/MyCompanyInfoComponent.tsx | 4 +- .../pages/SemanticHub/ModelDetailDialog.tsx | 4 +- src/components/pages/SemanticHub/index.tsx | 4 +- .../components/MarketplaceHeader/index.tsx | 8 +- .../UserManagement/ActiveUserTable/index.tsx | 6 +- src/components/shared/frame/Header/index.tsx | 8 +- src/features/user/slice.ts | 3 +- src/features/user/types.ts | 5 +- src/services/AccessService.tsx | 49 ++++-- src/services/UserService.ts | 58 +----- src/types/Config.tsx | 166 ++++++++++-------- src/types/Constants.ts | 2 + src/types/MainTypes.ts | 16 +- .../{multiMapBy.test.ts => dataUtils.test.ts} | 50 +++++- src/utils/{multiMapBy.ts => dataUtils.ts} | 21 +++ 27 files changed, 267 insertions(+), 209 deletions(-) rename src/utils/{multiMapBy.test.ts => dataUtils.test.ts} (79%) rename src/utils/{multiMapBy.ts => dataUtils.ts} (77%) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1c3c1fdf..92c9ade2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ - Page headers - harmonization and standardization of page headers - Use scroll to top button from shared components +- Enable more fine grained permission checks by client id and roles ## 2.0.0 diff --git a/index.html b/index.html index 1a72c3909..50b42181f 100644 --- a/index.html +++ b/index.html @@ -29,7 +29,7 @@
diff --git a/src/components/overlays/CompanyCertificateDetails/index.tsx b/src/components/overlays/CompanyCertificateDetails/index.tsx index 8bd3e5d84..7391f37df 100644 --- a/src/components/overlays/CompanyCertificateDetails/index.tsx +++ b/src/components/overlays/CompanyCertificateDetails/index.tsx @@ -46,8 +46,8 @@ import { useEffect, useState } from 'react' import { OVERLAYS, ROLES } from 'types/Constants' import dayjs from 'dayjs' import LoadingProgress from 'components/shared/basic/LoadingProgress' -import UserService from 'services/UserService' import { SortType } from 'components/pages/CompanyCertificates' +import { userHasPortalRole } from 'services/AccessService' export enum StatusTag { PENDING = 'Pending', @@ -209,7 +209,7 @@ export default function CompanyCertificateDetails({