6

We receive "Cannot grant or remove a profile with modify all data, without having the modify all data permission yourself." exception message when it shouldn't appear.

When there are two users, User Test 1 and User Test 2. User Test 2 has a permission set assigned with "Modify All Data" permission (but doesn't have that permission at profile level). User Test 1 doesn't have "Modify All Data" permission either in profile or in permission sets. When User Test 1 tries to perform dummy update of User Test 2 (no fields are changed or modified), an error is thrown "Cannot grant or remove a profile with modify all data, without having the modify all data permission yourself." even though no change in profile happens.

I am not sure if I should open Salesforce support ticket or is there any way to workaround this bug? I don't want to give "Modify All Data" permission to User Test 1.

=========

Dummy update is like update new User(Id=UserInfo.getUserId()), so no fields are changed

I would also provide a screen capturing video to explain that I do not use any code but rather I just update user from UI enter image description here

  • 1
    Personally I'd recommending going ahead and logging a case. But given the poor response time of salesforce support, I'd continue searching for a work around you can implement. – Ralph Callaway Jun 4 '18 at 16:02
  • 1
    I don't understand the "Dummy update" part, Can you please elaborate? – Mr.Frodo Jun 4 '18 at 16:03
  • yes, dummy update is like update new User(Id=UserInfo.getUserId()), so no fields are changed – Patlatus Jun 5 '18 at 9:08
  • I added a screen capturing video to explain better – Patlatus Jun 7 '18 at 15:31
  • 2
    @RalphCallaway, yes, I have logged a case on Monday, firstly Salesforce Support replied to me that this is by design, but after I talked to the manager of that Salesforce Support lady and explained that even though a user doesn't have modify all data permission, still this user can update another user who has modify all data permission in profile but not assigned by a permission set, and after that they started investigation but didn't reply anything yet to me. They keep saying that they don't have any updates from Tier 3 – Patlatus Jun 9 '18 at 10:14
1

We have opened a case in Salesforce Support. Initially they said that this is expected behavior but later in a month time they have found a known issue with Reference W-2922695 they have discovered themselves in February.

Meanwhile we have found another workaround for our particular problem. We used automated process to update users from a user who doesn't have Modify All permission. We ended up writing a custom Apex Rest Service class to run in System context (without sharing) and we call that Apex Rest service class from a user who doesn't have Modify All permission in the automated process and it works for us for now. I think that if this was added to known issue list of workarounds then this might help another Salesforce customers who face the same issue.

0

If you are making this from apex code you can try to make the update of the User record in system mode, that is, by declaring the corresponding apex class as without sharing.

Let me know if this solves your issue.

  • I did this from UI, the user who updates the record, doesn't have Author Apex permission – Patlatus Jun 5 '18 at 9:41
  • @Patlatus Is it really necessary for you to make this update? I don't see the reason why you want to do it. – Enrik Hysko Jun 5 '18 at 9:48
  • Yes, it is necessary. we have automated process which performs automatical update even if no fields is changed, and this platform bug is blocker for our functionality – Patlatus Jun 5 '18 at 10:04

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.