Is it possible to show only Leads or Cases to a running user based on Queues he is member of?

I am trying to limit the leads (or cases in the future) that a running users sees in a table based on the queue he is a member of. So, if user is a member of only Small Business queue then he should see only Small Business leads. By the way, users in our org have access to all queues, so this can’t be handled with permissions. It’s just for user convenience. 

I’ve tried building models with groups, groupmembers, but I can’t get it to work. When I try to pull in UserOrGroupId object, I get the following error: “There was an error retrieving metadata for object: Group,PartnerNetworkConnection,User: Invalid SObject name Group,PartnerNetworkConnection,User. No metadata could be retrieved.”

Figured it out based on this post:…

Exported the XML provided in the question above and modified it slightly by removing the GroupsContainingThe… models since they were unnecessary, deleting the PendingApprovals model and adding a Leads model with the Condition OwnerId in UserGroups. Leads model loads second, after the UserGroup models.