Commit 40161086 authored by Bartek Górny's avatar Bartek Górny

added listDAVObjects

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12392 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c43a0c17
......@@ -30,7 +30,7 @@ import re
import string
import pdb
from AccessControl import ClassSecurityInfo
from AccessControl import ClassSecurityInfo, getSecurityManager
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions
......@@ -326,6 +326,21 @@ class ContributionTool(BaseTool):
return BaseTool._delOb(self, id)
def listDAVObjects(self):
"""
Get all docs contributed by the current user
XXX you can only list them this way, but they're not accessible
to make it fully usable we should set their id's with module name
and possibly something nicer to display
"""
sm = getSecurityManager()
u = sm.getUser()
kw = {}
res = self.portal_catalog(portal_type=self.getPortalDocumentTypeList())
res = [r.getObject() for r in res]
res = [o for o in res if u.allowed(o, ('Owner',))] # XXX terrible - needs to use portal_catalog
return res
InitializeClass(ContributionTool)
# vim: filetype=python syntax=python shiftwidth=2
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment