diff --git a/product/ERP5/Document/WebSection.py b/product/ERP5/Document/WebSection.py index a97caf65bc6bb3a1be47e97a4c8be49838aa207d..88b66ae04cc3559d5a996b3009c139561fc86757 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): """