Need recommendation regarding sharing a custom object(Relationship) records to community users:
We have a customer community accessible for community users(customer community license), the requirement is to display custom object records on a couple of community pages using custom LWC components and Apex code.
Now, I have two options to share the custom Object records -
Set External OWD to "Private" and use apex class with "Without sharing" and use custom code to limit who will see what.(I am sure there is no standard community page exposed to users.)
Set External OWD to "Public Read only" and use apex class with "with sharing" and custom code will make sure that user will access only records they need to see.
Please advise what is the recommended solution, my requirement can not be achieved by sharing set/groups at all.