Default
The Portal User is a contact in Dataverse. By default, the portal user can update his details that are available under my profile section. The user does have the default functionality to see data that are associated with another contact if both contact belongs to the same Account.
Scenario
User A (Doctor)
User P (Patient 1)
User Q (Patient 2)
User R (Patient 3)
User X (Father of User P)
User Y (Mother of User Q)
User Z (Legal guardian of User R)
In the system, all the users are Contacts and they have access to data that are related to their profile (as Contact)
All the users are linked to each other using Connection Roles (OOB Functionality)
Question
How to configure Portal Security so that below data visibility is possible.
Doctor (User A) can see data associated with all the patients (User P, User Q, and User R)
Patients (user P, User Q and User R) can see their data only.
User X can see his own data + User P's data
User Y can see his own data + User Q's data
User Z can see his own data + User R's data