+ Start a Discussion
Matthias GuentherMatthias Guenther 

FIELD_INTEGRITY_EXCEPTION, This user is a portal administrator and must have a profile with the "Edit Self-Service Users" permission.: [UserPermissions]

Hi:
Since the Winter 19 release, I am getting the above error when I run any unit test that modified a user record.

We are using the User License type: Overage Authenticated Website

I cannot locate the permission "Edit Self-Service Users" I turned off the enhanced user management to look for it and also tried giving my Users a permission set with all permissions under Users section.

Doing some research on previous posts about the  "Edit Self-Service Users" that what was recommended.

Thanks in advance,
Best Answer chosen by Matthias Guenther
Matthias GuentherMatthias Guenther
I got this solved via salesforce support.
Create a permission set, salesforce licenses type >> App permissions >> Call Center >> check the "Manage Customer Users" checkbox >> assign to the user that is having the problem or to the user being used in the unit testing 

All Answers

SandhyaSandhya (Salesforce Developers) 
Hi,


Grant the User the 'Manage Users' permission or remove them from the Delegated Admin group if the admin is delegated admin.

https://help.salesforce.com/articleView?id=000213205&type=1
 
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
                                             
Best Regards
Sandhya
 

 
Matthias GuentherMatthias Guenther
I tied this already, but it did not solve the problem Matthias
Joseph MurawskiJoseph Murawski
I have a similar situation where my apex code is trying to update a user and get this error.  The user is part of the system administrator profile which already has "Manage Users" permission.  The suggested solution is NOT the answer here.  Looking for another suggestion.
Matthias GuentherMatthias Guenther
I got this solved via salesforce support.
Create a permission set, salesforce licenses type >> App permissions >> Call Center >> check the "Manage Customer Users" checkbox >> assign to the user that is having the problem or to the user being used in the unit testing 
This was selected as the best answer
Andy Norman 3Andy Norman 3
We have the same issue with some old tests in one of our preprod orgs. The user in question is an admin and definitely already has the "Manage Users" permission.
KSKumaarKSKumaar
Thanks Matthias, I got solution for the same issue. Cheers.