Scenario : Account and Contact both are private for external users.
A user (A) from community creates a new contact and an email is triggered to the contact for registration flow.
The registration flow opens up with a guest user profile and contact started registration and a portal user (B) is created.
Now when the new user (B) is created and when he logs in to
digital experience, he is not able to modify his contact because the contact owner is user (A).
In this case there are few options,
- update the contact owner to User (B)
- create a group and share the user to that group (in that group only one user will be there).
- create a share record
ContactSharewith userId as User (B) and Contact Id as the contact id, and ContactAccessLevel as 'Edit'
I am going for 3rd option, but not sure of the pitfalls in that. Also this needs to happen programmatically so option 1 seems impossible.