Skip to content

Commit 92e3f6a

Browse files
author
Richard Jones
committed
merge(ish) from HEAD
1 parent 5d93cfc commit 92e3f6a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Fixed:
1010
- s/Modifed/Modified (thanks donfu)
1111
- applied patch fixing some form handling issues in ZRoundup (thanks Chris
1212
Withers)
13+
- enforce View Permission when serving file content (sf bug 1050470)
1314

1415

1516
2004-10-15 0.7.8

roundup/cgi/client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.176.2.6 2004-10-26 07:59:28 richard Exp $
1+
# $Id: client.py,v 1.176.2.7 2004-11-05 04:57:50 richard Exp $
22

33
"""WWW request handler (also used in the stand-alone server).
44
"""
@@ -445,6 +445,11 @@ def serve_file(self, designator, dre=re.compile(r'([^\d]+)(\d+)')):
445445
if not props.has_key('content'):
446446
raise NotFound, designator
447447

448+
# make sure we have permission
449+
if not self.db.security.hasPermission('View', self.userid, classname):
450+
raise Unauthorised, self._("You are not allowed to view "
451+
"this file.")
452+
448453
mime_type = klass.get(nodeid, 'type')
449454
content = klass.get(nodeid, 'content')
450455
lmt = klass.get(nodeid, 'activity').timestamp()

0 commit comments

Comments
 (0)