Mercurial > p > roundup > code
diff roundup/cgi/client.py @ 2018:96a1bf48efdd
Remove duplication in permission handling:
* Use execute() as a Template Method, with permission() and handle()
as the hook methods.
* Provide a default implementation for the permission() method, which
checks for self.permissionType, if the attribute is defined.
* New hasPermission() method which checks whether the current user has
a permission on the current class
editItemPermission method:
* Better error message when user is editing roles when they shouldn't be.
* Extracted isEditingSelf(), which checks whether a user is editing
his/her own details.
* Use hasPermission method.
| author | Johannes Gijsbers <jlgijsbers@users.sourceforge.net> |
|---|---|
| date | Sat, 14 Feb 2004 19:58:20 +0000 |
| parents | 95f2c726f664 |
| children | 8fab5d394f22 |
line wrap: on
line diff
--- a/roundup/cgi/client.py Sat Feb 14 17:18:01 2004 +0000 +++ b/roundup/cgi/client.py Sat Feb 14 19:58:20 2004 +0000 @@ -1,4 +1,4 @@ -# $Id: client.py,v 1.159 2004-02-14 11:27:23 jlgijsbers Exp $ +# $Id: client.py,v 1.160 2004-02-14 19:58:20 jlgijsbers Exp $ """WWW request handler (also used in the stand-alone server). """ @@ -554,7 +554,7 @@ raise ValueError, 'No such action "%s"'%action # call the mapped action try: - action_klass(self).handle() + action_klass(self).execute() except TypeError: # Old way of specifying actions. getattr(self, action_klass)()
