Secure Apex Code with User Mode Database Operations (Generally Available)
The new Database and Search methods support an accessLevel parameter that lets you run database and search operations in user mode instead of in the default system mode. This feature, now generally available, includes some changes since the last release. Apex code runs in system mode by default, which means that it runs with substantially elevated permissions over the user running the code. To enhance the security context of Apex, you can specify user mode access for database operations. Field-level security (FLS) and object permissions of the running user are respected in user mode and it always applies sharing rules. In system mode, the class sharing keywords control the sharing rules. Where: This change applies to Lightning Experience and Salesforce Classic in Enterprise, Performance, Unlimited, and Developer editions. How: You can indicate the mode of the operation by using WITH USER_MODE or WITH SYSTEM_MODE ...
Comments
Post a Comment