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