From 4e69c9ad25f4e42165b7255098149ae43feca254 Mon Sep 17 00:00:00 2001 From: Jean-Paul Smets <jp@nexedi.com> Date: Mon, 17 Mar 2008 09:28:16 +0000 Subject: [PATCH] Added layout property getter with explicit acquisition. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19953 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/WebSection.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/product/ERP5/Document/WebSection.py b/product/ERP5/Document/WebSection.py index a97caf65bc..88b66ae04c 100644 --- a/product/ERP5/Document/WebSection.py +++ b/product/ERP5/Document/WebSection.py @@ -117,6 +117,19 @@ class WebSection(Domain, PermanentURLMixIn): return PermanentURLMixIn.__bobo_traverse__(self, request, name) + security.declareProtected(Permissions.AccessContentsInformation, 'getLayoutProperty') + def getLayoutProperty(self, default): + """ + A simple method to get a property of the current by + acquiring it from the current section or its parents + """ + section = aq_inner(self) + while section.getPortalType() in ('Web Section', 'Web Site'): + result = section.getProperty(default) + if result: + return result + section = section.aq_parent + security.declareProtected(Permissions.AccessContentsInformation, 'getWebSectionValue') def getWebSectionValue(self): """ -- 2.30.9