From 24ef066569ec487d4b98b5604c3787e9c17aefbc Mon Sep 17 00:00:00 2001 From: Ian Bolton Date: Tue, 12 Dec 2023 10:20:52 -0500 Subject: [PATCH] :bug: Fix migrator permissions (#1612) Resolves https://issues.redhat.com/browse/MTA-1640 Signed-off-by: ibolton336 --- .../applications-table/applications-table.tsx | 138 ++++++++++++------ client/src/app/rbac.ts | 42 +++++- 2 files changed, 135 insertions(+), 45 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 ed93b6b30..2189169a0 100644 --- a/client/src/app/pages/applications/applications-table/applications-table.tsx +++ b/client/src/app/pages/applications/applications-table/applications-table.tsx @@ -58,8 +58,16 @@ import keycloak from "@app/keycloak"; import { RBAC, RBAC_TYPE, + analysisReadScopes, + analysisWriteScopes, applicationsWriteScopes, + assessmentReadScopes, + assessmentWriteScopes, + credentialsWriteScopes, + dependenciesWriteScopes, importsWriteScopes, + reviewsReadScopes, + reviewsWriteScopes, tasksReadScopes, tasksWriteScopes, } from "@app/rbac"; @@ -542,8 +550,16 @@ export const ApplicationsTable: React.FC = () => { const userScopes: string[] = token?.scope.split(" ") || [], importWriteAccess = checkAccess(userScopes, importsWriteScopes), applicationWriteAccess = checkAccess(userScopes, applicationsWriteScopes), + assessmentWriteAccess = checkAccess(userScopes, assessmentWriteScopes), + analysisWriteAccess = checkAccess(userScopes, analysisWriteScopes), + assessmentReadAccess = checkAccess(userScopes, assessmentReadScopes), + credentialsWriteAccess = checkAccess(userScopes, credentialsWriteScopes), + dependenciesWriteAccess = checkAccess(userScopes, dependenciesWriteScopes), + analysisReadAccess = checkAccess(userScopes, analysisReadScopes), tasksReadAccess = checkAccess(userScopes, tasksReadScopes), - tasksWriteAccess = checkAccess(userScopes, tasksWriteScopes); + tasksWriteAccess = checkAccess(userScopes, tasksWriteScopes), + reviewsWriteAccess = checkAccess(userScopes, reviewsWriteScopes), + reviewsReadAccess = checkAccess(userScopes, reviewsReadScopes); const areAppsInWaves = selectedRows.some( (application) => application.migrationWave !== null @@ -973,27 +989,41 @@ export const ApplicationsTable: React.FC = () => { > {application?.effort ?? "-"} + -