Guys,
I need to know the exact use of unrestrictedTraverse().From the docs what I understood is ,
It will check for the permissions on a content for the particular user and return all the objects irrespective of the roles.
I have used it in the following code,
portal_catalog=api.portal.get_tool('portal_catalog')
stories=portal_catalog(path="/".join(self.context.getPhysicalPath()),portal_type='story')
self.context.plone_log(stories)
for brain in stories:
i+=1
story=self.context.unrestrictedTraverse(brain.getObject())
self.context.plone_log(story.worked_hrs)
yield({
'id':'sub_progress',
'url':brain.getURL(),
'comment':story.title,
'name':story.owners,
'owners':story.owners,
'date':story.date,
'worked_hrs':story.worked_hrs,
})
story=self.context.unrestrictedTraverse(brain.getObject())
but I am recieving the following error:
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module plone.autoform.view, line 47, in __call__
Module plone.autoform.view, line 38, in render
Module Products.Five.browser.pagetemplatefile, line 125, in __call__
Module Products.Five.browser.pagetemplatefile, line 59, in __call__
Module zope.pagetemplate.pagetemplate, line 132, in pt_render
Module five.pt.engine, line 93, in __call__
Module z3c.pt.pagetemplate, line 163, in render
Module chameleon.zpt.template, line 261, in render
Module chameleon.template, line 171, in render
Module 70a35f81e7106c84b455932399dfa9ad.py, line 590, in render
Module daf1c743ecceb868b86eead62aa0eaaa.py, line 1223, in render_master
Module daf1c743ecceb868b86eead62aa0eaaa.py, line 420, in render_content
Module 70a35f81e7106c84b455932399dfa9ad.py, line 279, in __fill_content_core
Module chameleon.tal, line 471, in __call__
Module plonexp.leocorn.browser.story, line 17, in storyList
Module OFS.Traversable, line 165, in unrestrictedTraverse
IndexError: list index out of range
I need the list of stories irrespective of the user roles and access.
Kindly help me