[Zope] has_permission in PythonMethod

Stefan H. Holek stefan@epy.co.at
Thu, 30 Nov 2000 19:33:04 +0100 (CET)


I have this (internal) PythonMethod called filtered_meta_types

user=self.REQUEST.AUTHENTICATED_USER
meta_types=[]
if callable( self.all_meta_types ):
  all=self.all_meta_types()
else:
  all=self.all_meta_types
for meta_type in all:
  if meta_type.has_key( 'permission' ):
    # this is always false :(
    if user.has_permission( meta_type['permission'], context ): 
      meta_types.append( meta_type )
  else:
    meta_types.append( meta_type )
return meta_types

I do not get why the 'has_permission' condition is always false
If I mimic this function in DTML (yuk), it *does* work.

TIA,
Stefan

--
Things work better when plugged in