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
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. 
Tom Connolly 2Tom Connolly 2

There is a link from a Known Issue to this article.  We had a new user and everytime she opened a LEX window the Welcome to LIghtning pop up would show.  Finally found that it is a new user adoption screen called the Welcome Mat.  So for me navigating to Setup->Adoption Assistance-> Welcome Mat and then turning it off resolved the issue!!Adoption Assistance