diff --git a/Lazy.py b/Lazy.py index 43c4417d..0d4a6844 100644 --- a/Lazy.py +++ b/Lazy.py @@ -82,12 +82,15 @@ # attributions are listed in the accompanying credits file. # ############################################################################## -__doc__='''$Id: Lazy.py,v 1.1 1999/06/22 14:14:47 michel Exp $''' -__version__='$Revision: 1.1 $'[11:-2] +__doc__='''$Id: Lazy.py,v 1.2 2000/05/11 18:54:16 jim Exp $''' +__version__='$Revision: 1.2 $'[11:-2] class Lazy: + # Allow (reluctantly) access to unprotected attributes + __allow_access_to_unprotected_subobjects__=1 + def __repr__(self): return `list(self)` def __len__(self): diff --git a/Vocabulary.py b/Vocabulary.py index 88a5e64e..0e9fa09d 100644 --- a/Vocabulary.py +++ b/Vocabulary.py @@ -85,7 +85,7 @@ """ZCatalog product""" from Globals import HTMLFile, MessageDialog -import Globals +import Globals, AccessControl.Role from Acquisition import Implicit from Persistence import Persistent from OFS.SimpleItem import Item @@ -104,7 +104,9 @@ def manage_addVocabulary(self, id, title, globbing=None, REQUEST=None): return self.manage_main(self,REQUEST) -class Vocabulary(Item, Persistent, Implicit): +class Vocabulary(Item, Persistent, Implicit, + AccessControl.Role.RoleManager, + ): """ A Vocabulary is a user managable relization of a Lexicon object. @@ -115,15 +117,15 @@ class Vocabulary(Item, Persistent, Implicit): manage_options=( - -## {'label': 'Manage', 'action': 'manage_main', -## 'target': 'manage_main'}, - + ( {'label': 'Vocabulary', 'action': 'manage_vocabulary', 'target': 'manage_main'}, {'label': 'Query', 'action': 'manage_query', 'target': 'manage_main'}, ) + +Item.manage_options + +AccessControl.Role.RoleManager.manage_options + ) __ac_permissions__=( diff --git a/ZCatalog.py b/ZCatalog.py index 7dcb4b95..72280acb 100644 --- a/ZCatalog.py +++ b/ZCatalog.py @@ -101,6 +101,7 @@ from SearchIndex import UnIndex, UnTextIndex from Vocabulary import Vocabulary import IOBTree +from AccessControl import getSecurityManager manage_addZCatalogForm=HTMLFile('addZCatalog',globals()) @@ -166,9 +167,6 @@ class is that it is not Zope specific. You can use it in any icon='misc_/ZCatalog/ZCatalog.gif' manage_options=( - {'label': 'Contents', 'action': 'manage_main', - 'target': 'manage_main', - 'help':('ZCatalog','ZCatalog_Contents.dtml')}, {'label': 'Cataloged Objects', 'action': 'manage_catalogView', 'target': 'manage_main', 'help':('ZCatalog','ZCatalog_Cataloged-Objects.dtml')}, @@ -184,7 +182,7 @@ class is that it is not Zope specific. You can use it in any {'label': 'Status', 'action': 'manage_catalogStatus', 'target':'manage_main', 'help':('ZCatalog','ZCatalog_Status.dtml')}, - ) + )+Folder.manage_options __ac_permissions__=( @@ -540,8 +538,6 @@ def ZopeFindAndApply(self, obj, obj_ids=None, obj_metatypes=None, if obj_expr: # Setup expr machinations md=td() - if hasattr(REQUEST, 'AUTHENTICATED_USER'): - md.AUTHENTICATED_USER=REQUEST.AUTHENTICATED_USER obj_expr=(Eval(obj_expr, expr_globals), md, md._push, md._pop) base=obj @@ -633,8 +629,10 @@ def absattr(attr): return attr -class td(TemplateDict, cDocument): - pass +class td(TemplateDict): + + def validate(self, inst, parent, name, value, md): + return getSecurityManager().validate(inst, parent, name, value) def expr_match(ob, ed, c=InstanceDict, r=0): e, md, push, pop=ed