Commit 83fd85b0 authored by Jérome Perrin's avatar Jérome Perrin

VCS: Allow developer to store working copies outside of instance home

parent 23fe52ef
...@@ -34,6 +34,7 @@ from base64 import b64encode, b64decode ...@@ -34,6 +34,7 @@ from base64 import b64encode, b64decode
from tempfile import gettempdir from tempfile import gettempdir
import transaction import transaction
from AccessControl import Unauthorized from AccessControl import Unauthorized
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.SecurityInfo import ModuleSecurityInfo from AccessControl.SecurityInfo import ModuleSecurityInfo
from Acquisition import aq_base, Implicit from Acquisition import aq_base, Implicit
from App.config import getConfiguration from App.config import getConfiguration
...@@ -128,8 +129,10 @@ class WorkingCopy(Implicit): ...@@ -128,8 +129,10 @@ class WorkingCopy(Implicit):
for allowed in getConfiguration().instancehome, gettempdir(): for allowed in getConfiguration().instancehome, gettempdir():
if issubdir(allowed, path) or issubdir(allowed, real_path): if issubdir(allowed, path) or issubdir(allowed, real_path):
return real_path return real_path
if 'Developer' not in getSecurityManager().getUser().getRoles():
raise Unauthorized("Unauthorized access to path %r." raise Unauthorized("Unauthorized access to path %r."
" It is NOT in your Zope home instance." % path) " It is NOT in your Zope home instance." % path)
return real_path
def _getCookie(self, name, default=None): def _getCookie(self, name, default=None):
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment