fix: use correct the userID column name in permissions v2 check (#10467)

# Which Problems Are Solved

When `Permission Check V2` is enabled, calls to the `ListPasskeys` and
`ListAuthenticationFactors` APIs fail with the following error:
```
ERROR:  missing FROM-clause entry for table "users14"
```

# How the Problems Are Solved
By using the right UserID column
(`projections.user_auth_methods5.user_id`) in the permission clause in
the `userAuthMethod` query

# Additional Changes
N/A

# Additional Context
- Closes #10386
This commit is contained in:
Gayathri Vijayan
2025-08-12 17:17:39 +02:00
committed by GitHub
parent 427cbe06f3
commit 45cc6e9bb1

View File

@@ -112,7 +112,7 @@ func userAuthMethodPermissionCheckV2(ctx context.Context, query sq.SelectBuilder
ctx,
UserAuthMethodColumnResourceOwner,
domain.PermissionUserRead,
OwnedRowsPermissionOption(UserIDCol),
OwnedRowsPermissionOption(UserAuthMethodColumnUserID),
)
return query.JoinClause(join, args...)
}