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
from tempfile import gettempdir
import transaction
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
......@@ -128,8 +129,10 @@ class WorkingCopy(Implicit):
for allowed in getConfiguration().instancehome, gettempdir():
if issubdir(allowed, path) or issubdir(allowed, real_path):
return real_path
raise Unauthorized("Unauthorized access to path %r."
" It is NOT in your Zope home instance." % path)
if 'Developer' not in getSecurityManager().getUser().getRoles():
raise Unauthorized("Unauthorized access to path %r."
" It is NOT in your Zope home instance." % path)
return real_path
def _getCookie(self, name, default=None):
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