Commit 18801f46 authored by Jérome Perrin's avatar Jérome Perrin

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

parent 9861d856
......@@ -33,6 +33,7 @@ import errno, json, os, re, shutil
from base64 import b64encode, b64decode
from tempfile import gettempdir
from AccessControl import Unauthorized
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.SecurityInfo import ModuleSecurityInfo
from Acquisition import aq_base, Implicit
from App.config import getConfiguration
......@@ -127,6 +128,7 @@ class WorkingCopy(Implicit):
if restricted and not any(
issubdir(allowed, path) or issubdir(allowed, real_path)
for allowed in (getConfiguration().instancehome, gettempdir())):
if 'Developer' not in getSecurityManager().getUser().getRoles():
raise Unauthorized("Unauthorized access to path %r."
" It is NOT in your Zope home instance." % path)
if os.path.isdir(real_path):
......
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