I'm getting the
[Exception: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))] when trying to import documentSet programmatically from a site collection document library to another document lib located in on of his subsites.
PS: this code works perfectly with a FULL Control in site collection but not with contribute or Modification Role.
My question is what is the minimum role to be able to execute the code?
SPList publishingList = publishingWeb.TryGetListByUrl("PublishedCases/"); byte compressedFile = docSet.Export(); SPContentType secondCt = publishingList.ContentTypes["DOCLIB"]; SPFolder targetFolder = publishingList.RootFolder; DocumentSet publishedDocSet = DocumentSet.Import(compressedFile, myitem.Name, targetFolder, secondCt.Id, properties, elevateWeb.CurrentUser);