I want to restrict all the users to edit the some other user's profile(P1,P2,P3) who belongs to let say list custom setting UserLS.
Now I want if any user edit the other user's(UserLS) profile and if the other user having profile IN (P1,P2,P3), then it will trow error.
But if the users belongs to list custom setting UserLS try to edit the profile for the other UserLS user having profile IN (P1,P2,P3) then they can.
I tried with using OOB but nothing worked fine.
Now, I am trying to write the custom code for it. Please guide me to do that.