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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Nov 18 22:03:22 CET 2011


Author: bh
Date: 2011-11-18 22:03:05 +0100 (Fri, 18 Nov 2011)
New Revision: 5625

Modified:
   base/trunk/mpulsweb/controllers/formularpage.py
Log:
Check access permissions in FormularpageController.select
by using the _load_current_case method to load the case and using the
new instance_tree parameter of get_rendered_page to avoid loading the
instance tree twice just for rendering.

Implements the access checks for showing a form page for mpuls/issue2367.


Modified: base/trunk/mpulsweb/controllers/formularpage.py
===================================================================
--- base/trunk/mpulsweb/controllers/formularpage.py	2011-11-18 20:49:32 UTC (rev 5624)
+++ base/trunk/mpulsweb/controllers/formularpage.py	2011-11-18 21:03:05 UTC (rev 5625)
@@ -115,7 +115,8 @@
 
     @checkRole(('admin', 'cm', 'pt_dlr'))
     def select(self, id):
-        c.formular = get_rendered_page(id)
+        case = self._load_current_case(read_only=True)
+        c.formular = get_rendered_page(id, case.get_formed_instance_tree())
         return render('/formularpage/formular.mako')
 
     @checkRole(('cm'))



More information about the Mpuls-commits mailing list