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.

Thank you.


The system permissions that control access to profile changes are all-or-nothing. You also cannot write triggers or declarative automation on the Profile object: it is not a normal Sobject, but part of the metadata that defines your organization. As such, most code (... that doesn't call out to the Metadata API) cannot modify or impact this metadata.

Delegated administration allows for users to take on some administrative responsibilities, including assignment of permission sets, but it doesn't extend to modification of profiles.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.