Skip to content

Commit 74c5c0a

Browse files
author
Richard Jones
committed
enforce View Permission when serving file content [SF#1050470]
1 parent 06d6b95 commit 74c5c0a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CHANGES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ Fixed:
4848
- loosened the detection of issue cross-references in messages
4949
- open CSV files in "universal newline" mode
5050
- s/Modifed/Modified (thanks donfu)
51-
- applied patch fixing some form handling issues in ZRoundup (thanks Chris
52-
Withers)
51+
- applied patch fixing some form handling issues in ZRoundup (sf bug 995565)
52+
- enforce View Permission when serving file content (sf bug 1050470)
5353

5454

5555
2004-10-15 0.7.8

roundup/cgi/client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.195 2004-11-03 09:49:14 a1s Exp $
1+
# $Id: client.py,v 1.196 2004-11-05 04:55:52 richard Exp $
22

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

534+
# make sure we have permission
535+
if not self.db.security.hasPermission('View', self.userid,
536+
classname, 'content', nodeid):
537+
raise Unauthorised, self._("You are not allowed to view "
538+
"this file.")
539+
534540
mime_type = klass.get(nodeid, 'type')
535541
content = klass.get(nodeid, 'content')
536542
lmt = klass.get(nodeid, 'activity').timestamp()

0 commit comments

Comments
 (0)