Search code examples
pythoncmisopencmisapache-chemistry

CMIS PermissionDeniedException


I'm trying to get service(SAP mobile document) via CMIS.

In service web client i can create folder and add file.

Via CMIS I can auth and get repo's list, but that's all. For other methods I get cmislib.exceptions.PermissionDeniedException: Error 403

I used this doca http://chemistry.apache.org/python/docs/

from cmislib import *

client = CmisClient('https://service/mcm/b/atom', 'user', 'pwd')
print client.getRepositories()

#REPO
#repo = client.defaultRepository
repo = client.getRepository('573f7fc4-2c76-49a2-b63c-d39e370edfde')
print repo.name

#FOLDER
rFolder = repo.rootFolder
print rFolder.id

#denied
#rFolder.getChildren()
#acl = rFolder.getACL()
#print rFolder.getName()
#newFolder = rFolder.createFolder('testfolder')

denied returns

cmislib.exceptions.PermissionDeniedException: Error 403 at https://url/mcm/b/atom/573f7fc4-2c76-49a2-b63c-d39e370edfde/id?id=906f3ae3-a4c9-3210-7292-c840e0cff769&filter=&includeAllowableActions=false&includeACL=false&includePolicyIds=false&includeRelationships=&renditionFilter=

*the same error for default repo

#repo = client.defaultRepository


Solution

  • SAP Mobile Documents requires cookies. Turn cookies on on the client side and those exceptions will disappear.

    See http://help.sap.com/saphelp_mdocs10/helpdata/en/0e/432781e0c646a09602a4aab786734d/content.htm?frameset=/en/d5/476115e8264a33a52fd59d260892cb/frameset.htm&current_toc=/en/69/ec44f07b34409a8b65005f51315f1a/plain.htm&node_id=105 how to the authentication works.