Problem with borg.localroles cache

thomas desvenain <[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <CAFn5D-jCHjq9TDvm0kYKOkNxbD=c8SNAKzhMzB7JiVDFUZipjQ@mail.gmail.com>
Hi

borg.localroles uses annotations on requests to cache roles

https://github.com/plone/borg.localrole/blob/master/borg/localrole/workspace.py

The problem is that on my Plone 4.3 site, request is not
IAttributeAnnotatable.

    if IAnnotations(request, None) is None:
        raise DontCache

I think it is an issue as the method comments says :

"

 So let's add one and try again.  Before we also need to mark it as
 being annotatable, which normally happens elsewhere:
"


On this project I manually added the interface :

  from zope.annotation.interfaces import IAttributeAnnotatable
  classImplements(HTTPRequest, IAttributeAnnotatable)

it makes me earn 30% time !

-- 
Thomas Desvenain

Téléphone : 09 51 37 35 18

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk

_______________________________________________
Plone-developers mailing list
Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/plone-developers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.