[Mpuls-commits] r5230 - in base/trunk: . mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Aug 12 13:22:46 CEST 2011


Author: ludwig
Date: 2011-08-12 13:22:45 +0200 (Fri, 12 Aug 2011)
New Revision: 5230

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/lib/security.py
Log:
Logging added to the checkRole function (Issue2241).

Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2011-08-10 13:49:07 UTC (rev 5229)
+++ base/trunk/ChangeLog	2011-08-12 11:22:45 UTC (rev 5230)
@@ -1,3 +1,9 @@
+2011-08-11  Ludwig Reiter <ludwig.reiter at intevation.de>
+
+	* mpulsweb/lib/security.py:
+	Logging added to the checkRole function (Issue2241). With this
+	an unauthorized response of missing role is displayed in the logs.
+
 2011-08-10  Ludwig Reiter <ludwig.reiter at intevation.de>
 
 	* mpulsweb/i18n/mpulsweb.pot,

Modified: base/trunk/mpulsweb/lib/security.py
===================================================================
--- base/trunk/mpulsweb/lib/security.py	2011-08-10 13:49:07 UTC (rev 5229)
+++ base/trunk/mpulsweb/lib/security.py	2011-08-12 11:22:45 UTC (rev 5230)
@@ -379,6 +379,8 @@
 
     def validate(func, self, *args, **kwargs):
         if not hasRole(_role):
+            log.exception('Not authorised to look at the requested document. '
+                          'Returns an HTTP Unauthorized response.')
             raise HTTPUnauthorized(detail=_('You are not authorised to '
                 'look at the requested document.'))
         try:



More information about the Mpuls-commits mailing list