0

I am working on product and we have lot of Apex Batch Classes developed, I submitted my org code for Checkmarx review and I got lot of security review changes regarding CRUD and FLS check.

However I am wondering about Apex Batch, do CRUD checks and FLS checks are required for batch class as they are running in system mode?

Please advise.

Thanks,
Nachiket

  • Great. I posted as an answer so you can close out the question if you wish – Eric Feb 23 '17 at 6:19
  • @Eric Thank you so much for prompt reply, yeah I was about to say you to post these comments into answer so that I can accept the answer! – Nachiket Deshpande Feb 23 '17 at 6:26
3

if you can state the reason for the "system mode" and it is valid then you submit those reasons when you submit the app for review. The scanner is a tool not the decision maker. The security team will be checking to ensure that the code you have running in "system mode" should be doing so and allow it if appropriate

Batch class is no different that any other class in that regard. "With Sharing" respects sharing, "Without Sharing" does not. As for FLS all code has access to ALL fields. That is why you are supposed to explicitly check and handle it within your code

| improve this answer | |

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.