+ Start a Discussion
Marty C.Marty C. 

Customer Community user changing profile photo for another user

Using Visualforce and Apex, is it possible to allow a user with the Customer Community User license to change the profile photo for another user having the same license? For example, let's say Adam and Frank are both community users. I want to enable Adam to log into the community, then change the profile picture for Frank.

Right now, I'm trying to use ConnectApi.ChatterUsers.setPhoto() (https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_ConnectAPI_ChatterUsers_static_methods.htm#apex_ConnectAPI_ChatterUsers_static_methods), but I'm getting an error: Insufficient Privileges: You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.

The relevant code snippet is shown below:
 

ConnectApi.ChatterUsers.setPhoto(
    MyNeds.getNetworkId(), getCommunityUser().Id, photoInput);

ShashankShashank (Salesforce Developers) 
I'm afraid a community user cannot change the profile photo of another community user. You would need a system administrator user to so it.