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
This commit is contained in:
helmutm 2010-05-02 12:41:02 +00:00
parent c2a5a9cca8
commit e70bea85e5

View file

@ -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