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
The underlying security model of the portal is heavily tied to the Relationships (1:N, N:N) between Tables.
You will want to make sure you have distinct relationship for the Doctor-Patient, and another one for Parent-Patient, The portal supports both 1:N and N:N relationships (if using N:N you can either use the out of the box, or create what is known as a 'manual' N:N - where you create the intersect table by adding a Lookup to each respective table).
Edit: and as per Olivers original post, avoid Connection Roles with the portal.
Hello Oliver,
In my case, Doctors, patients and relatives are contacts and linked with each other using connection roles.
Can I use N:N relationship to map the records and use the same to set filtering and display in power pages?
I wouldn't recommend using "Connections" within Dataverse, the proper way to associate the data in the back-end is via Relationships.
Power Pages security model will allow you to secure the data via Web Roles + Table Permissions to solve your problem, but first you need to make sure you have the proper relationships setup.
Example:
Fubar
69
Super User 2025 Season 1
oliver.rodrigues
49
Most Valuable Professional
Jon Unzueta
43