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
chioikbhchioikbh 

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.

 

Regards

Wen

Arun MKArun MK

 

Hi,

 

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

 

Regards,

Arun.

chioikbhchioikbh

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