From e70bea85e5682fa5f10e2b78337977ccc9bb1db3 Mon Sep 17 00:00:00 2001 From: helmutm Date: Sun, 2 May 2010 12:41:02 +0000 Subject: [PATCH] prepare for hiding concepts from parents portlet for certain roles git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3834 fd906abe-77d9-0310-91a1-e0d9ade77398 --- browser/concept.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/browser/concept.py b/browser/concept.py index 97d8dc2..04cd8b7 100644 --- a/browser/concept.py +++ b/browser/concept.py @@ -313,7 +313,11 @@ class ConceptView(BaseView): def isHidden(self, pr): hideRoles = IOptions(adapted(pr.first.conceptType))('hide_for', None) if hideRoles is not None: - roles = getRolesForPrincipal(self.request.principal.id, self.context) + principal = self.request.principal + if (IUnauthenticatedPrincipal.providedBy(principal) and + 'zope.Anonymous' in hideRoles): + return True + roles = getRolesForPrincipal(principal.id, self.context) for r in roles: if r in hideRoles: return True