Logo Search packages:      
Sourcecode: zope-i18nfolder version File versions

def zope-i18nfolder-2.02::I18NFolder::I18NFolder::listFolderContents (   self,
  spec = None,
  contentFilter = None,
  suppressHiddenFiles = 0 
)

Hook around 'contentValues' to let 'folder_contents'
be protected.  Duplicating skip_unauthorized behavior of dtml-in.

In the world of Plone we do not want to show objects that begin with a .
So we have added a simply check.  We probably dont want to raise an
Exception as much as we want to not show it.

Definition at line 331 of file I18NFolder.py.

00331                                                                                         : 
        """
        Hook around 'contentValues' to let 'folder_contents'
        be protected.  Duplicating skip_unauthorized behavior of dtml-in.
        
        In the world of Plone we do not want to show objects that begin with a .
        So we have added a simply check.  We probably dont want to raise an
        Exception as much as we want to not show it.
        
        """

        items = self.contentValues(spec=spec, filter=contentFilter)
        l = []
        for obj in items:
            id = obj.getId()
            v = obj
            try:
                if suppressHiddenFiles and id[:1]=='.': 
                    raise Unauthorized(id, v)
                if getSecurityManager().validate(self, self, id, v):
                    l.append(obj)
            except (Unauthorized, 'Unauthorized'):
                pass
        return l

    # Add all languages in catalog
    security.declareProtected(View, 'SearchableText')


Generated by  Doxygen 1.6.0   Back to index