I was onsite at a client’s site today and I created a couple of test entries in a list they had created, to test some workflow functionality. That was all well and good, until I went and tried to delete the dummy data.
Survey Says: Access Denied!
What the hell? It was getting close to the end of the day and after about 15 minutes I decided to put the issue aside and attack it the next morning with a fresh set of caffeine-enhanced eyes.
Rock up the next morning, jump in the drivers seat and go…
"Okay, so this is not standard OTB SharePoint functionality… Which means there’s probably a feature somewhere that’s trying to preserve data integrity… and it doesn’t stop me from editing the item, just deleting it, so it’s probably hooking into the ItemDeleting event or something…"
One quick look at the Features folder later (ordered by last modified) and I notice that there are several features there… but the one I’m most interested in is the one called "ManageEventHandlers" – Oooooh, I wonder what this one does!
In the feature.xml file you can normally find the description of what the feature does (which is easier than trying to find the feature and the site it’s been deployed to using the UI), so I cracked it open and – Oh happy days – The author was proud enough of their work to put a reference in there to their own site – A big cheerio to Brian Wilson from MCS UK 🙂
The feature is actually a good one to have, as it lets you hook events that occur in SharePoint up to DLL code you have written – and all using the UI… but the client did not know that they were using free open-source code on their site, so the person who initially set up the site clearly had not heeded the warnings in this article.
So this time the feature in question adds a link to the settings pages of lists and libraries, called Event Receivers – this lets you pick and event, then identify an assembly and method to use when that feature gets called. In my list, there was 2 methods connected to the "ItemDeleting" event – remove them, and everything comes good 🙂