0

please share your idea's

my salesforce org integrated with serviceNow system middle ware is snapLogic . I created one api user in salesforce (i.e Integration User). when record inserted in servicenow, snapLogic api called it will created record in salesforce object called snow_approve__c ,when record created trigger will fire, trigger handlerClass querying on different(obj1,obj2,...) objects.

Issue: Integration User(api user) i need give all object permissions, because apex code is running as Integration user context how do i restrict api user without assigning all object permissions. or any other way when record created by Integration user triggerCode will run in another salesforce user context

1 Answer 1

1

any other way when record created by Integration user triggerCode will run in another salesforce user context

No, you cannot change the running user context of an Apex trigger. There are a handful of ways in which functionality can cause downstream processing to take place in a different user context (e.g., Platform Events), but not in the way you appear to be looking for here.

how do i restrict api user without assigning all object permissions.

Are you enforcing FLS, CRUD, and Sharing Rules in your Apex code? Apex runs in system mode, and these facets are not enforced against you (except Sharing Rules if you declare your class with sharing).

Your integration user clearly needs CRUD to the snow_approve__c object, because it's being directly mutated via the API. If your Apex code is not explicitly enforcing FLS and CRUD, you probably do not need to grant permission to other objects with which your trigger handler interacts.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .