While developing an Apex class with custom search functionality that will be launched from a Lightning Web Component, how can the developer ensure only records accessible to the currently logged in user are displayed?
There was a practice question about filtering records based on user permissions, and I think we might need to use SOQL queries with the `WHERE` clause for that.
I've done something similar before. I'd use the WITH SECURITY_ENFORCED clause in the SOQL query to automatically apply the user's permissions. Should be a straightforward fix.
This seems tricky. I'll need to research how to properly handle user permissions in an Apex class that's called from a Lightning Web Component. Might take some time to figure out the right solution.
Okay, I think I've got a plan. I'll use the System.UserInfo class to get the current user's ID, then build a dynamic SOQL query to only return records they have access to.
Beatriz
9 hours agoWei
6 days agoBettina
11 days agoTennie
16 days agoCasie
21 days agoHobert
26 days agoRyan
1 month agoEmogene
1 month agoMilly
1 month agoFiliberto
2 months agoArthur
2 months agoLamonica
2 months agoPamella
3 months agoTyra
3 months agoThora
3 months agoVilma
3 months ago