I've just gone through a biggish code base making sure that WITH SECURITY_ENFORCED is set on every query. Most were, but for some recent additions, it hadn't been included. For managed packages that need to go through security reviews, this is a great way to respect object and field level security on reads. But tedious to manually check big code bases, especially where dynamic SOQL is used.
- Does anyone have a PMD Apex Security Rule created for this that they would be happy to share?
- IMHO it would be great if
WITHbecame the default mode at say API 55 with a
WITHOUT SECURITY_ENFORCEDoption also provided. (Or some other mechanism used to turn