Exception:
System.SecurityException: Required permissions are not enabled.
Resolution:
Exception “System.SecurityException: Required permissions are not enabled.” is thrown if the running user doesn’t have the required permission to perform the operations.
For example,
- To execute Anonymous Apex code, the users need “Author Apex” permission.
- To send Email from Lead or Contact, the user needs “Send Email” permission.
- To send Email from Apex, Author Apex permission is required.