Commit 1a9f582d authored by Jim Fulton's avatar Jim Fulton

Updated the hook to reject unauthorized versions to also clear the

associated database version pool.
parent d257f500
......@@ -118,7 +118,8 @@ def startup():
def validated_hook(request, user):
newSecurityManager(request, user)
if request.get(Globals.VersionNameName, ''):
version = request.get(Globals.VersionNameName, '')
if version:
object = user.aq_parent
if not getSecurityManager().checkPermission(
'Join/leave Versions', object):
......@@ -127,6 +128,7 @@ def validated_hook(request, user):
expires="Mon, 25-Jan-1999 23:59:59 GMT",
path=(request['BASEPATH1'] or '/'),
)
Zope.DB.removeVersionPool(version)
raise Unauthorized, "You don't have permission to enter versions."
......
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