@@ -26,6 +26,7 @@ const USER_PRIVATE_DENY_POLICY2 = `path "openhorizon/metadata/%s/user/*" {capabi
26
26
// All supported openhorizon users will have these policies attached.
27
27
const USER_PRIVATE_POLICY1 = `path "openhorizon/data/%s/user/%s/*" {capabilities = ["create", "update", "read"]}`
28
28
const USER_PRIVATE_POLICY2 = `path "openhorizon/metadata/%s/user/%s/*" {capabilities = ["list", "read", "delete"]}`
29
+ const USER_PRIVATE_POLICY3 = `path "openhorizon/metadata/%s/user/%s" {capabilities = ["list"]}`
29
30
30
31
// Ensure that the right ACL policies exist so that they can be attached to the user's token.
31
32
func (o * ohAuthPlugin ) setupUserPolicies (userOrg string , userId string , admin bool , vaultToken string ) (policyName string , err error ) {
@@ -166,7 +167,8 @@ func getPolicyString(userOrg string, userId string, admin bool) (policyString st
166
167
adminUserPrivateDeny2 := fmt .Sprintf (USER_PRIVATE_DENY_POLICY2 , userOrg )
167
168
userPrivatePolicy1 := fmt .Sprintf (USER_PRIVATE_POLICY1 , userOrg , userId )
168
169
userPrivatePolicy2 := fmt .Sprintf (USER_PRIVATE_POLICY2 , userOrg , userId )
169
- policyString = fmt .Sprintf ("%s %s %s %s %s" , nonAdminPolicy , adminUserPrivateDeny1 , adminUserPrivateDeny2 , userPrivatePolicy1 , userPrivatePolicy2 )
170
+ userPrivatePolicy3 := fmt .Sprintf (USER_PRIVATE_POLICY3 , userOrg , userId )
171
+ policyString = fmt .Sprintf ("%s %s %s %s %s %s" , nonAdminPolicy , adminUserPrivateDeny1 , adminUserPrivateDeny2 , userPrivatePolicy1 , userPrivatePolicy2 , userPrivatePolicy3 )
170
172
}
171
173
172
174
return
0 commit comments