Sometimes in custom SharePoint solution you need to execute custom code using System Account privileges than the current logged in user which may not have sufficient rights to execute custom code. In these situations we use RunWithElevatedPrivileges() method to delegate System Account rights to current logged in user.
When you put your code inside RunWithElevatedPrivileges() code block it runs using the App Pool account, so you must ensure that the App Pool account is a member of a site collection group with sufficient perms to to add/edit/delete or whatever your code is trying to do.
If not, the code will quietly break without popping an exception.
Sometimes in custom SharePoint solution you need to execute custom code using System Account privileges than the current logged in user which may not have sufficient rights to execute custom code. In these situations we use RunWithElevatedPrivileges() method to delegate System Account rights to current logged in user.
When you put your code inside RunWithElevatedPrivileges() code block it runs using the App Pool account, so you must ensure that the App Pool account is a member of a site collection group with sufficient perms to to add/edit/delete or whatever your code is trying to do.
If not, the code will quietly break without popping an exception.