One of the most important things in programming and executing DML operations is security. You don't want to provide user access to delete records via Apex while the user is not allowed to do that operation in the regular user interface.
In the chapters about data modeling, you learned about the different ways to provide access to an object, a field, or a record. Be aware that Apex, in certain circumstances, runs in system mode, and the execution of the code doesn't take into account the user's access rights (with the result that the user can do things that are not available in the regular interface). Let's take a look at what we need to perform to protect our data in Apex.