I'm using the following code to let users without full access rights on my site deleting it through a custom layouts page (delete site button):
SPSecurity.RunWithElevatedPrivileges(delegate() {
using (SPSite Site = SPContext.Current.Site) {
Site.AllowUnsafeUpdates = true;
Site.Delete();
Site.AllowUnsafeUpdates = false;
}
});
I get an access denied for the non site collection user trying to do this:
Deleting the site at http:// and not deleting AD accounts.
Unknown SPRequest error occurred. More information: 0x80070005
An SPRequest object was not disposed before the end of this thread.