When using the Salesforce Partner API (version 21.0), how can I determine if the current user/session is able to create a new Content Version?
Using describeGlobal() I can confirm ContentVersion and ContentDocument are available as objects for the current organization.
Using describeSObject() I can confirm that the the current users session marks ContentVersion as createable. I've also confirmed that the fields I'm setting when inserting the ContentVersion record are marked as createable (PathOnClient, VersionData and FirstPublishedLocationId).
In my test cases, if the user has access to the Content area via the Salesforce web interface then the test case passes with the ContentVersion being created.
However, when I try the same code from a developer edition org (without access to the Content area) it falls over with the message:
FIELD_INTEGRITY_EXCEPTION - User doesn't have access to Salesforce Content. Invalid field value:: Content Origin
The createable Partner API metadata for ContentVersion and the fields indicated that this should have worked.
I'm working in C#, but the Java code in recipe Publishing Documents Into a Salesforce CRM Content Personal Workspace is doing much the same thing without the creatable metadata checks.
To try and rule out my code as the cause of the issue I've confirmed that the ContentVersion should be createable using Force.com Explorer: