[Mpuls-commits] r5362 - base/trunk/mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Sep 16 10:27:55 CEST 2011


Author: roland
Date: 2011-09-16 10:27:53 +0200 (Fri, 16 Sep 2011)
New Revision: 5362

Modified:
   base/trunk/mpulsweb/controllers/administration.py
Log:
issue1616: Add a before_delete-hook to deleteUser

Add hook to perform application specific acions before deleting user, for
example, removing the user from the structure part's user table.


Modified: base/trunk/mpulsweb/controllers/administration.py
===================================================================
--- base/trunk/mpulsweb/controllers/administration.py	2011-09-15 17:46:30 UTC (rev 5361)
+++ base/trunk/mpulsweb/controllers/administration.py	2011-09-16 08:27:53 UTC (rev 5362)
@@ -1,5 +1,35 @@
 # -*- coding: utf-8 -*-
 
+#
+# Copyright 2007, 2008 Intevation GmbH, Germany, <info at intevation.de>
+#
+# This file is part of mpuls WASKA (CoMPUter-based case fiLeS -
+# Web-Anwendungs-Server fuer Kompetenzagenturen).
+#
+# mpuls WASKA is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# mpuls WASKA is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Affero General Public
+# License along with mpuls WASKA. If not, see <http://www.gnu.org/licenses/>.
+#
+# mpuls WASKA has been developed on behalf of the
+# Projekttraeger im Deutschen Zentrum fuer Luft- und Raumfahrt e.V. (PT-DLR)
+# within the programme Kompetenzagenturen (Durchfuehrungsphase) funded by
+# the Bundesministerium fuer Familie, Senioren, Frauen und Jugend and
+# European Social Fund resources.
+#
+# Authors:
+# Torsten Irländer <torsten.irlaender at intevation.de>
+# Sascha L. Teichmann <teichmann at intevation.de>
+# Roland Geider <roland.geider at intevation.de>
+
 import logging
 import formencode
 
@@ -226,6 +256,7 @@
                 c.delete_user_id = id
                 return render('/administration/delete_user_helper.mako')
             else:
+                self._before_delete_user(id, confirmed='0')
                 uo.delete()
                 c.success_for = _('User deleted!')
                 c.success_text = _('User sucessfully deleted. '
@@ -248,6 +279,15 @@
                                action='overviewUser')
             return render('/administration/dialogs/confirm_deleteuser.mako')
 
+
+    def _before_delete_user(self, id, confirmed='0'):
+        """
+        Application specific actions to perform before actually deleting the user.
+        For example, applications with a structure part can remove the rights to
+        the user to access it.
+        """
+        pass
+
     @checkRole('admin')
     def deleteUserHelper(self):
         validator = DeleteUserHelperForm()



More information about the Mpuls-commits mailing list