Mercurial > p > roundup > code
diff roundup/mailgw.py @ 2747:8b6cd1c5d549 maint-0.7
pydotorg-specific change to mailgw to handle bizzaro permissions ;)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 11 Oct 2004 05:20:37 +0000 |
| parents | 7f24a0222d36 |
| children | 07166758e412 |
line wrap: on
line diff
--- a/roundup/mailgw.py Fri Oct 08 08:10:59 2004 +0000 +++ b/roundup/mailgw.py Mon Oct 11 05:20:37 2004 +0000 @@ -72,7 +72,7 @@ an exception, the original message is bounced back to the sender with the explanatory message given in the exception. -$Id: mailgw.py,v 1.149.2.3 2004-09-29 08:47:59 a1s Exp $ +$Id: mailgw.py,v 1.149.2.4 2004-10-11 05:20:37 richard Exp $ """ __docformat__ = 'restructuredtext' @@ -572,6 +572,10 @@ m.append(s.getvalue()) self.mailer.bounce_message(message, sendto, m) + def hasPermissions(self, author, classname, nodeid): + # make sure they're allowed to edit this class of information + return self.db.security.hasPermission('Edit', author, classname) + def handle_message(self, message): ''' message - a Message instance @@ -790,8 +794,7 @@ raise Unauthorized, 'You are not permitted to access '\ 'this tracker.' - # make sure they're allowed to edit this class of information - if not self.db.security.hasPermission('Edit', author, classname): + if not self.hasPermissions(author, classname, nodeid): raise Unauthorized, 'You are not permitted to edit %s.'%classname # the author may have been created - make sure the change is
