Fix key list filtering for models based on user ids
(cherry picked from commit 7f33d297552a2bc32958aa9c9743df665e3e7c91)