In CloudKit, how do I check whether the user of an app is the share-sender or the share-receiver?

In other words, I’m trying to setup sharing in my app using Core Data with CloudKit. Basically the user can share their list of CloudKit records with other users of the app. Should that other user accept that share from that share-sender, the share-receiver can then sees the sender’s list of records. This part works as I need it to. This is fine. As well, the app is largely being written in SwiftUI.

However, what I also need is to give the user the ability to see only their own records, or to set one of their records to private. I think I can figure this logic out, but I’m still not sure of how to filter the sender versus receiver of that share, AKA owner vs participant.

I’ve tried several things to figure this out, and I keep coming up empty. I feel like there’s a good way to do this, however what I’ve done always has issues.

Can someone please describe the best way to do this?

In CloudKit, how do I check whether the user of an app is the share-sender or the share-receiver?
 
 
Q