- Account read privilege is at user level
- Sharing rule allows Users to see other User's Account records, Read privilege only.
- An LWc on a Visualforce Page allows a user to perform some business process on any account.
- The above causes a new record to be created in AccountContactRelation(ACR) object.
Issue/Error (see title) at step 4
- This is because the User is not having "write" privilege on other User's Account record. Only read via sharing rules.
Options tried but didn't work
- Apex job: same issue: I thought it will run under system/admin mode but the same error says that its running under user mode. Why ?
- Without Sharing explicitly mentioned on the apex control class that handles the ACR record creation. Runs in User Mode.
- Writing code under trigger also fails. And trigger runs under system mode.
- Cannot set object level permission on ACR OBJECT in permission set.
- Will Modify All on Account work ?
- How to run in system mode either sync or async ?
- How to check runtime if my apex code is running under user or system mode.