def listFolderContents(self, contentFilter=None, suppressHiddenFiles=0): """Optionally you can suppress "hidden" files, or files that begin with a dot. """ contents = BasePortalFolder.listFolderContents(self, contentFilter=contentFilter) if suppressHiddenFiles: contents = [obj for obj in contents if obj.getId()[:1] != '.'] return contents
def manage_delObjects(self, ids=[], REQUEST=None): """We need to enforce security.""" if isinstance(ids, basestring): ids = [ids] for id in ids: item = self._getOb(id) if not _checkPermission(permissions.DeleteObjects, item): raise Unauthorized( "Do not have permissions to remove this object") return BasePortalFolder.manage_delObjects(self, ids, REQUEST=REQUEST)
def __getitem__(self, key): """Overwrite __getitem__. At first it's using the BaseObject version. If the element can't be retrieved from the schema it's using BasePortalFolder as fallback which should be the ObjectManager's version. """ try: return BaseObject.__getitem__(self, key) except KeyError: return BasePortalFolder.__getitem__(self, key)
def __init__(self, oid, **kwargs): # Call skinned first cause baseobject will set new defaults on # those attributes anyway BasePortalFolder.__init__(self, oid) BaseObject.__init__(self, oid, **kwargs)