Skip to content

Commit

Permalink
🐛 Fix analyses details required permissions (#1656)
Browse files Browse the repository at this point in the history
- Addresses an issue with the analysis details permissions.
analysis:get -> analyses:get

Signed-off-by: ibolton336 <[email protected]>
  • Loading branch information
ibolton336 authored Jan 11, 2024
1 parent c226ee6 commit 2ea144d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1031,7 +1023,7 @@ export const ApplicationsTable: React.FC = () => {
},
]
: []),
...(analysisReadAccess && hasExistingAnalysis
...(analysesReadAccess && hasExistingAnalysis
? [
{
title: t("actions.analysisDetails"),
Expand Down
13 changes: 1 addition & 12 deletions client/src/app/rbac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +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.analysis:get",
"archetypes.analysis:get",
];
export const analysesReadScopes = ["applications.analyses:get"];

export const assessmentWriteScopes = [
"applications.assessments:put",
Expand Down

0 comments on commit 2ea144d

Please sign in to comment.