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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Nov 21 16:55:04 CET 2011


Author: bh
Date: 2011-11-21 16:55:03 +0100 (Mon, 21 Nov 2011)
New Revision: 5636

Modified:
   base/trunk/mpulsweb/controllers/repeatgroup.py
Log:
Check access permissions in RepeatgroupController.new
by using the _load_current_case method to load a case object instead of
merely loading the instance tree.

Implements the access checks for creating new repeat group instances for
mpuls/issue2367.


Modified: base/trunk/mpulsweb/controllers/repeatgroup.py
===================================================================
--- base/trunk/mpulsweb/controllers/repeatgroup.py	2011-11-21 15:40:56 UTC (rev 5635)
+++ base/trunk/mpulsweb/controllers/repeatgroup.py	2011-11-21 15:55:03 UTC (rev 5636)
@@ -69,10 +69,8 @@
     def new(self, id):
         """New rg"""
         log.debug("creating new repeat group %s" % id)
-        factory = InstanceFactory(g.formedTree, PostgresDBInterface())
-        instance_tree = factory.loadInstanceTreeByIdentifier(
-            session['case'].id,
-            session.get('uncommited_fields'))
+        case = self._load_current_case()
+        instance_tree = case.get_formed_instance_tree()
         rgcontainer = instance_tree.getItem(id)
         if not rgcontainer:
             abort(404, _('repeat group container not found.'))



More information about the Mpuls-commits mailing list