function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
OpsterOpster 

How does With Sharing effect queries?

If my apex controller uses With Sharing, how does that effect the queries?  Specifically, if the current user does not have permission to view a certain record X, what will be returned by the soql query if I do a Select X?

 

 

sornasorna

If your controller uses with sharing, then only the records for which the current user have read permission, are retrieved from the queries.

If the user does not have the read permission, then those records are not retrieved...