I am trying to query the user table from a controller called by a lightning component in Communities.
User usr = [SELECT Id, Name, Email, Phone FROM User
WHERE Id IN (Select OwnerId From Account Where Id = :u.AccountId)
Running this from a community user it returns 0 rows. My sharing settings on the user record are private but the controller is using the without sharing notation. If I my self run that query I get the expected result.
return [SELECT Id, Name, Profile.Name, AccountId,
WHERE Id =:UserInfo.getUserId()];
This query works. Is there some weird sharing setting that I am missing?
Basically I just want to be able to query the user table from a community user and can't.