Skip to content

Commit 8b4d91a

Browse files
author
Richard Jones
committed
pydotorg-specific change to mailgw to handle bizzaro permissions ;)
1 parent d641c75 commit 8b4d91a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Fixed:
2121
- handle deleted properties in RDBMS history
2222
- apply timezone in correct direction in user input (sf bug 1013097)
2323
- more efficient find() in RDBMS (sf bug 1012781)
24+
- pydotorg-specific change to mailgw to handle bizzaro permissions ;)
2425

2526

2627
2004-07-21 0.7.6

roundup/mailgw.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class node. Any parts of other types are each stored in separate files
7272
an exception, the original message is bounced back to the sender with the
7373
explanatory message given in the exception.
7474
75-
$Id: mailgw.py,v 1.149.2.3 2004-09-29 08:47:59 a1s Exp $
75+
$Id: mailgw.py,v 1.149.2.4 2004-10-11 05:20:37 richard Exp $
7676
"""
7777
__docformat__ = 'restructuredtext'
7878

@@ -572,6 +572,10 @@ def handle_Message(self, message):
572572
m.append(s.getvalue())
573573
self.mailer.bounce_message(message, sendto, m)
574574

575+
def hasPermissions(self, author, classname, nodeid):
576+
# make sure they're allowed to edit this class of information
577+
return self.db.security.hasPermission('Edit', author, classname)
578+
575579
def handle_message(self, message):
576580
''' message - a Message instance
577581
@@ -790,8 +794,7 @@ def handle_message(self, message):
790794
raise Unauthorized, 'You are not permitted to access '\
791795
'this tracker.'
792796

793-
# make sure they're allowed to edit this class of information
794-
if not self.db.security.hasPermission('Edit', author, classname):
797+
if not self.hasPermissions(author, classname, nodeid):
795798
raise Unauthorized, 'You are not permitted to edit %s.'%classname
796799

797800
# the author may have been created - make sure the change is

0 commit comments

Comments
 (0)