mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 09:27:50 +00:00
fix: hide envs without read permission in the env filter dropdown
This commit is contained in:
@@ -600,7 +600,17 @@ export const SecretOverviewPage = () => {
|
|||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent align="end">
|
<DropdownMenuContent align="end">
|
||||||
<DropdownMenuLabel>Choose visible environments</DropdownMenuLabel>
|
<DropdownMenuLabel>Choose visible environments</DropdownMenuLabel>
|
||||||
{userAvailableEnvs.map((availableEnv) => {
|
{userAvailableEnvs
|
||||||
|
.filter(({ slug }) =>
|
||||||
|
permission.can(
|
||||||
|
ProjectPermissionActions.Read,
|
||||||
|
subject(ProjectPermissionSub.Secrets, {
|
||||||
|
environment: slug,
|
||||||
|
secretPath
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.map((availableEnv) => {
|
||||||
const { id: envId, name } = availableEnv;
|
const { id: envId, name } = availableEnv;
|
||||||
|
|
||||||
const isEnvSelected = visibleEnvs.map((env) => env.id).includes(envId);
|
const isEnvSelected = visibleEnvs.map((env) => env.id).includes(envId);
|
||||||
|
|||||||
Reference in New Issue
Block a user