Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: hide envs without read permission in secret main page nav header dropdown

Scott Wilsonb5c9b6a1bd9a
diff --git a/frontend/src/views/SecretMainPage/SecretMainPage.tsx b/frontend/src/views/SecretMainPage/SecretMainPage.tsx
index c4ee5e4e58..14cd7b9b87 100644
--- a/frontend/src/views/SecretMainPage/SecretMainPage.tsx
+++ b/frontend/src/views/SecretMainPage/SecretMainPage.tsx
@@ -344,7 +344,15 @@ export const SecretMainPage = () => {
<NavHeader
pageName={t("dashboard.title")}
currentEnv={environment}
- userAvailableEnvs={currentWorkspace?.environments}
+ userAvailableEnvs={currentWorkspace?.environments.filter(({ slug }) =>
+ permission.can(
+ ProjectPermissionActions.Read,
+ subject(ProjectPermissionSub.Secrets, {
+ environment: slug,
+ secretPath
+ })
+ )
+ )}
isFolderMode
secretPath={secretPath}
isProjectRelated