+ Start a Discussion

User with Portal Profile's permission on User

I have query a query on User object


List us = [Select AvatarId__c, CommunityNickname from User where Id = :id];


I am 100% sure it should return a record and it did when I run as my 'System administrator' profile. But if I run this line as portal profile, then it can't find the matched User who has another non-portal profile at all. So I get us.size() is 0.


Does anyone here can point what's the problem? For me, it looks like the portal profile doesn't have permission on users with other profile, but how can I solve this?


Thank you very much for the kind help.




Arun MKArun MK




Clone the existing Portal profile. On the newly created profile, give Read access to the User object. This should solve your problem.





The portal profile I used is already a customized one. And it is impossible to give read rights on User object.