Restrict the access to the defined path to view - KV engine version 1

Hello Experts,

I have a policy like below assigned to a group called group1. The user belongs to group1 should be allowed to view the only team1 path in the UI but now the user able to view all other paths under secretenginev1/ but I want to restrict that.

example:
team1
team2
team3
team4

group1 user should see only team1 path under secretenginev1
group2 user should see only team2 path under secretenginev1…etc

path "secretenginev1/team1/dept/*"
{
  capabilities = ["create", "read", "update", "delete", "list"]
}

path "secretenginev1/*"
{
  capabilities = ["list"]
}

# Allow a token to look up its own capabilities on a path
path "sys/capabilities-self" {
    capabilities = ["update"]
}

path "auth/token/create" {
  capabilities=["update", "sudo"]
}

Can you help me how can i achieve this ?

Remove the

path "secretenginev1/*"
{
  capabilities = ["list"]
}

and try again.

@Wolfsrudel nope it won’t work if I remove it … I can’t list from ui and will get 401