From 57588f1e19727fa962454c2e469b3b7fde535ef0 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Mon, 19 Oct 2015 09:30:23 +0200 Subject: [PATCH] fix access to manage_workspace page --- security/browser/manage_workspace.pt | 21 ++++++++++++++++++++- security/common.py | 11 +++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/security/browser/manage_workspace.pt b/security/browser/manage_workspace.pt index b31a4f7..406a256 100644 --- a/security/browser/manage_workspace.pt +++ b/security/browser/manage_workspace.pt @@ -1,6 +1,25 @@ + + + + +

Define Workspace Properties

@@ -54,7 +73,7 @@

Assign Permissions to Roles for Children of this Object


-
+ diff --git a/security/common.py b/security/common.py index 13e3835..7cc998a 100644 --- a/security/common.py +++ b/security/common.py @@ -28,6 +28,7 @@ from zope.app.security.settings import Allow, Deny, Unset from zope.cachedescriptors.property import Lazy from zope.interface import implements from zope.lifecycleevent import IObjectCreatedEvent, IObjectModifiedEvent +from zope.location.interfaces import IRoot from zope.security import canAccess, canWrite from zope.security import checkPermission as baseCheckPermission from zope.security.management import getInteraction @@ -219,6 +220,16 @@ class WorkspaceInformation(Persistent): def getParent(self): return self.__parent__ + def getParents(self): + parents = [] + w = self.__parent__ + while w is not None: + parents.append(w) + w = w.__parent__ + if parents and IRoot.providedBy(parents[-1]): + return parents + raise TypeError("Not enough context information to get all parents") + def getWorkspaceGroup(obj, predicate): wsi = obj.workspaceInformation