Help! - Dynamically restrict/allow multiple users access to records
Hello, I've read up on the Privilege Sets and was able to set it up for record access for a single user. I'm now stuck on how to dynamically allow specific as well as multiple users access to the same record.
I have the following tables...Patients, Care Period, and Nurses.
For a given Patient, s/he has one or more CarePeriod records.
For a given Care Period, one or more Nurses are assigned and removed from it as needed.
For the single user access setup, the Patients::NurseAccess field pulled the login name of the assigned nurse's login name from the Nurses table when their name was selected from Patients::NurseSelection dropdown box. In the custom Privilege Set - View access, I used Get(AccountName) = Patients::NurseAccess, which worked fine.
For the multiple users access setup, Patients::NurseAccess now has multiple nurse logins in it:
Without changing my custom privilege set, only NurseA can view the patient's record. NurseB or NurseC does not have access to view the Patient record.
Is it because the Privilege Set formula only checks the first returned value from the now multi-value field, Patient::NurseAccess? If so, how do I create a formula in the Privilege Set to check a Nurse's login name from a field that contains multiple login names?
The reason for this setup is that when some patients are not happy with a particular nurse from their assigned nurse pool, the nurse has to be rotated out and a new nurse is rotated in.
If my above setup is wrong or not ideal, what would be the ideal setup where the office employee can assign and remove, on demand, one or more Nurses' access from a Patient's record.
I hope I have explained it correctly.
Thank you for your help!