I have set item level secuirty on a document library folder, but when I try to delete the folder as a Site Admin I get acess denied. I try to Manage Permissions I get the following error in the log.
Cannot complete this action. Please try again. at Microsoft.SharePoint.Library.SPRequestInternalClass.GetSecurityInfo(String bstrUrl, String bstrObjUrl, Guid& pguidScopeId, UInt64& pEffectivePermMask, Boolean& pbHasUniquePerm, String& pbstrPermUrl) at Microsoft.SharePoint.Library.SPRequest.GetSecurityInfo(String bstrUrl, String bstrObjUrl, Guid& pguidScopeId, UInt64& pEffectivePermMask, Boolean& pbHasUniquePerm, String& pbstrPermUrl)
There might be some Itemdeleting Event imposed on that item in document library
Check for that....
Thanks, Sudhanshu Shekhar
I have tried as a site administrator and a farm administrator to delete the folder through the web interface. If I try to Manage Permissions I get the error above. The setting of item permissions is done via code.
if you want to set the permissions programmatically, then I would suggest you try to run it within an SPRunWithElevatedPrivileges block, as described here:
Please let us know whether this was of some help.
Martin W. Angler, MCTS
Twitter: Follow me on twitter
Thanks, the event handler runs with elevated privileges. Its sets the permissions on a folder in the root of the library, this folder contains subfolders and the subfolders documents. A Web Service provided by another supplier creates the root folder, the sub folders and uploads documents
The problem arose because of unforeseen interaction between the Web Service and the item event handler. The Web Service did not have site admin privileges and did not use run with elevated privileges.
The Web Service starts creating the folders, creates the root and then the subfolders. While this is happening my list item event handler fires and changes the permissions on the newly created root folder, this prevents the Web Service from creating all the subfolders because of lack of privileges.
The Web Service also left the root folder in a strange state where neither a farm admin or site collection admin can delete it.
We had multiple occurrences of this behavior at our company. Permissions of an item cannot be accessed (throws the exception in OP), item cannot be updated/deleted (access denied), not even by System account. We have only been able to delete that item by using proc_DropListRecord stored procedure directly on the content database. Anybody knows what causes this? Any information would be appreciated.
NecroSkillz - Thanks for the info - although not ideal - at least it has allowed me to carry on developing.
I've written some instructions on how to use the stored proc you mentioned on my thread.
Thanks, it is good to see a tech company in Wales, i'm Welsh myself.
It may not be the best way. But can you try to delay the execution on item added code(assuming you are using itemadded event). So that by that webservice finish execution and your event reciever code gets executed.
Please mark as helpful if it is really helpful