[Zope-CMF] Re: 'security' section in a .metadata (don't seem to work)

Tres Seaver tseaver at zope.com
Mon Jan 12 09:53:10 EST 2004


Andreas Jung wrote:
> I have a template xxx.pt in a skinfolder with metadatafile 
> xxx.pt.metatdata:
> 
> [default]
> title=hello world
> 
> [security]
> View=0:Authenticated
> 
> I expected that only authenticated users would be allowed to access the 
> template
> but anonymous users would be redirected to the login screen. But on my
> system anonymous users can access the template as well 
> (CMF-1.4.2)...anything
> I am missing?

There is a bug in the parsing of the config file which causes the 
"acquired" flag to always evalutate True.  Try the following patch:

------------   cut here --------------------------------------------
Index: CMFCore/FSMetadata.py
===================================================================
RCS file: /cvs-repository/CMF/CMFCore/FSMetadata.py,v
retrieving revision 1.4.4.1
diff -u -r1.4.4.1 FSMetadata.py
--- CMFCore/FSMetadata.py       24 May 2003 14:40:31 -0000      1.4.4.1
+++ CMFCore/FSMetadata.py       12 Jan 2004 14:51:52 -0000
@@ -100,7 +100,7 @@

          acquire, roles = data.split(':')
          roles = [r.strip() for r in roles.split(',') if r.strip()]
-        return (acquire, roles)
+        return (int(acquire), roles)

      def _getSectionDict(self, cfg, section, parser=None):
          """
------------   cut here --------------------------------------------

Tres.
-- 
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com




More information about the Zope-CMF mailing list