SPSecurity.RunWithElevatedPrivileges Access Denied

Suddenly of the pages has the access denied error causing from SPSecurity.RunWithElevatedPrivileges delegate method.  Just to highlight that this delegate method that is to run with elevated rights of a Application Pool identity (NOT primary administrator). Many new SharePoint developer still having this misleading information and I seen many like to abuse  and massively use this SPSecurity.RunWithElevatedPrivileges delegate method.

Back to my solution, I checked the Application Pool identity the user has been changed and does not have any permission in my site collection. Well, I working in a shared environment, sometimes people just change here and there without notification. Granting that account full control in my site solved the issue.

Leave a Reply

Your email address will not be published. Required fields are marked *