From 61235d28bc09b9d310df21c5457bdb32fd2af9c0 Mon Sep 17 00:00:00 2001 From: Ian Bolton Date: Thu, 14 Dec 2023 20:08:48 -0500 Subject: [PATCH] :bug: Address required manage credential scopes (#1627) https://issues.redhat.com/browse/MTA-1903 Signed-off-by: ibolton336 --- .../applications-table/applications-table.tsx | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/client/src/app/pages/applications/applications-table/applications-table.tsx b/client/src/app/pages/applications/applications-table/applications-table.tsx index 96ab5b594d..d0f6e06544 100644 --- a/client/src/app/pages/applications/applications-table/applications-table.tsx +++ b/client/src/app/pages/applications/applications-table/applications-table.tsx @@ -59,6 +59,7 @@ import { applicationsWriteScopes, assessmentReadScopes, assessmentWriteScopes, + credentialsReadScopes, credentialsWriteScopes, dependenciesWriteScopes, importsWriteScopes, @@ -547,6 +548,7 @@ export const ApplicationsTable: React.FC = () => { assessmentWriteAccess = checkAccess(userScopes, assessmentWriteScopes), analysisWriteAccess = checkAccess(userScopes, analysisWriteScopes), assessmentReadAccess = checkAccess(userScopes, assessmentReadScopes), + credentialsReadAccess = checkAccess(userScopes, credentialsReadScopes), credentialsWriteAccess = checkAccess(userScopes, credentialsWriteScopes), dependenciesWriteAccess = checkAccess(userScopes, dependenciesWriteScopes), analysisReadAccess = checkAccess(userScopes, analysisReadScopes), @@ -578,6 +580,7 @@ export const ApplicationsTable: React.FC = () => { , ] : []; + const applicationDropdownItems = applicationWriteAccess ? [ { {t("actions.delete")} , - { - setSaveApplicationsCredentialsModalState(selectedRows); - }} - > - {t("actions.manageCredentials")} - , + ...(credentialsReadAccess + ? [ + { + setSaveApplicationsCredentialsModalState(selectedRows); + }} + > + {t("actions.manageCredentials")} + , + ] + : []), ] : []; + const dropdownItems = [...importDropdownItems, ...applicationDropdownItems]; const isAnalyzingAllowed = () => { @@ -1011,7 +1019,7 @@ export const ApplicationsTable: React.FC = () => { ] : []), - ...(credentialsWriteAccess + ...(credentialsReadAccess && applicationWriteAccess ? [ { title: t("actions.manageCredentials"),