From b7f6963c4abdd611cfe71d4b7578f8f1d44cca76 Mon Sep 17 00:00:00 2001 From: ibolton336 Date: Fri, 5 Jan 2024 11:43:10 -0500 Subject: [PATCH] wip Signed-off-by: ibolton336 --- .../applications-table/applications-table.tsx | 16 ++++------------ client/src/app/rbac.ts | 15 +-------------- 2 files changed, 5 insertions(+), 26 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 62386a672b..13d6b52ffe 100644 --- a/client/src/app/pages/applications/applications-table/applications-table.tsx +++ b/client/src/app/pages/applications/applications-table/applications-table.tsx @@ -54,16 +54,12 @@ import keycloak from "@app/keycloak"; import { RBAC, RBAC_TYPE, - analysisReadScopes, - analysisWriteScopes, + analysesReadScopes, applicationsWriteScopes, - assessmentReadScopes, assessmentWriteScopes, credentialsReadScopes, - credentialsWriteScopes, dependenciesWriteScopes, importsWriteScopes, - reviewsReadScopes, reviewsWriteScopes, tasksReadScopes, tasksWriteScopes, @@ -542,16 +538,12 @@ export const ApplicationsTable: React.FC = () => { importWriteAccess = checkAccess(userScopes, importsWriteScopes), applicationWriteAccess = checkAccess(userScopes, applicationsWriteScopes), 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), + analysesReadAccess = checkAccess(userScopes, analysesReadScopes), tasksReadAccess = checkAccess(userScopes, tasksReadScopes), tasksWriteAccess = checkAccess(userScopes, tasksWriteScopes), - reviewsWriteAccess = checkAccess(userScopes, reviewsWriteScopes), - reviewsReadAccess = checkAccess(userScopes, reviewsReadScopes); + reviewsWriteAccess = checkAccess(userScopes, reviewsWriteScopes); const areAppsInWaves = selectedRows.some( (application) => application.migrationWave !== null @@ -1031,7 +1023,7 @@ export const ApplicationsTable: React.FC = () => { }, ] : []), - ...(analysisReadAccess && hasExistingAnalysis + ...(analysesReadAccess && hasExistingAnalysis ? [ { title: t("actions.analysisDetails"), diff --git a/client/src/app/rbac.ts b/client/src/app/rbac.ts index a51f753776..5f1aa09b3e 100644 --- a/client/src/app/rbac.ts +++ b/client/src/app/rbac.ts @@ -110,20 +110,7 @@ export const archetypesWriteScopes = [ "archetypes:delete", ]; -export const analysisWriteScopes = [ - "applications.analysis:put", - "applications.analysis:post", - "applications.analysis:delete", - "archetypes.analysis:put", - "archetypes.analysis:post", - "archetypes.analysis:delete", -]; -export const analysisReadScopes = [ - "applications.analyses:get", - "archetypes.analyses:get", - "applications.analysis:get", - "archetypes.analysis:get", -]; +export const analysesReadScopes = ["applications.analyses:get"]; export const assessmentWriteScopes = [ "applications.assessments:put",