Symptoms
Getting an ?access denies exception ? you do not have permission to perform this action or access this resource? when trying to execute a Create Folder method against a document library using the SharePoint Content Service.
Correlating error entries from the hostserver log:
The file name you specified could not be used. It may be the name of an existing file or directory, or you may not have permission to access the file.
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
at SourceCode.SharePoint.Client.ListBaseFunctions.getFolder(List list, String folderPath)
at SourceCode.SharePoint.Client.ListFunctions.CreateFolder(List list, String folderPath)
at SourceCode.SmartObjects.Services.SharePoint.Content.SmoSPListItemBase.executeCreateFolder(Propertyy] inputs)
at SourceCode.SmartObjects.Services.SharePoint.Content.SmoSPDocument.callCreateMethod(Propertyy] inputs, Propertyy] returns, Method method)
at SourceCode.SmartObjects.Services.SharePoint.Content.SmoSPDocument.Execute(Propertyy] inputs, RequiredProperties required, Propertyy] returns, Method method)
CONTEXT:
Running K2 blackpearl 4.12060.1731.1 (4.6.11) with SharePoint 2013 server but SharePoint site in question is on SharePoint 2010 mode. They have other SP sites/site collections with the exact same setup that do not have this issue i.e. they able to successfully execute the ?Create Folder? method against any document library on those sites. So the issue appears to be isolated to this one SP site.
Diagnoses
The issue was caused by a case sensitive comparison K2 did on the SharePoint URL. Specifically, this was done when trying to identify the sub site part of the URL.
In this particular case, the sub site is defined as PDB (all caps). We suspect the URL configured in the Content Service to be pdb (all lower cases), which caused SharePoint to returns either PDB or pdb depending on which API call is used.
Resolution
An isolated patch in the form of a coldfix was provided. The fix itself involved making the string comparisons for the URL case insensitive.
If you have a similar setup and run into the same issue please contact K2 Support.