Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Users

IPublishTraverse adapters and permissions

 

 

Zope users RSS feed   Index | Next | Previous | View Threaded


sdupton at gmail

Mar 6, 2009, 5:06 PM

Post #1 of 1 (800 views)
Permalink
IPublishTraverse adapters and permissions

I've been scratching my head on this one, any help is appreciated:

I've been using a traversal adapter implementing IPublishTraverse with
an application I am developing, and I want to have certain behaviors
of my traversal adapter protected by CMF permissions I'm otherwise
using.

Right now, my adapter is registered in ZCML:

<adapter
for="sdut.cportal.interfaces.IPortalMediaAsset
zope.publisher.interfaces.http.IHTTPRequest"
provides="zope.publisher.interfaces.IPublishTraverse"
factory=".editvia.AssetTraverser"
/>

And my AssetTraverser subclasses Acquisition.Explicit, but I'm not
sure how to make this participate in the security machinery. Ideally
I want to do this within AssetTraverser.publishTraverse():

sec = getSecurityManager()
sec.checkPermission(CMFCore.permissions.ModifyPortalContent, self.context)

But this will fail, likely for some acquisition voodoo I'm having
trouble figuring out (Five.BrowserView is somehow capable of dealing
with this scenario, but I'm not sure how to make my traversal adapter
do the same sort of thing).

Or, even more simply, I would love to be able to use
ClassSecurityInfo.declareProtected(permission, name) for some names my
traversal adapter will use (this does not do anything meaningful other
than generate warnings). Any ideas/pointers appreciated.

Thanks,
Sean
_______________________________________________
Zope maillist - Zope [at] zope
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Zope users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.