[Mpuls-commits] r5575 - base/trunk/mpulsweb/controllers
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Nov 15 12:50:43 CET 2011
Author: torsten
Date: 2011-11-15 12:50:43 +0100 (Tue, 15 Nov 2011)
New Revision: 5575
Modified:
base/trunk/mpulsweb/controllers/case.py
base/trunk/mpulsweb/controllers/case_bundle.py
Log:
Do not allow anonyisation if it is not enabled.
Modified: base/trunk/mpulsweb/controllers/case.py
===================================================================
--- base/trunk/mpulsweb/controllers/case.py 2011-11-15 10:27:05 UTC (rev 5574)
+++ base/trunk/mpulsweb/controllers/case.py 2011-11-15 11:50:43 UTC (rev 5575)
@@ -12,7 +12,7 @@
from mpulsweb.lib.translation import _, ungettext
from mpulsweb.lib.base import BaseController, render, session, h
-from mpulsweb.lib.security import checkRole
+from mpulsweb.lib.security import checkRole, check_feature
from mpulsweb.lib.dialogs import checkPrivacyStatement
from mpulsweb.lib.validators import SetStandinForm, SetEditorForm, NewCaseForm
from mpulsweb.lib.export import FormletterExport
@@ -192,6 +192,7 @@
@checkRole('cm')
def markForAnonymize(self, id, confirmed):
+ check_feature('case-module', 'anonyize')
url = h.url_for(controller='/case', action='digest', id=id)
return self._markForAnonymize(id, confirmed, url)
@@ -363,6 +364,7 @@
@checkRole('admin')
def anonymize(self, id, confirmed):
+ check_feature('case-module', 'anonyize')
id = self._checkInt(id)
confirmed = self._checkBool(confirmed)
case = self._loadCase(id)
Modified: base/trunk/mpulsweb/controllers/case_bundle.py
===================================================================
--- base/trunk/mpulsweb/controllers/case_bundle.py 2011-11-15 10:27:05 UTC (rev 5574)
+++ base/trunk/mpulsweb/controllers/case_bundle.py 2011-11-15 11:50:43 UTC (rev 5575)
@@ -365,6 +365,7 @@
# ANONYMIZE
@checkRole(('cm'))
def markAnonymize(self, confirmed):
+ check_feature('case-module', 'anonyize')
confirmed = self._checkBool(confirmed)
c.context = "../main.mako"
case_bundle = session.get('casebundle')
@@ -445,6 +446,8 @@
@checkRole(('admin'))
def anonymize(self, confirmed):
+ # check if feature is enabled or raise execption
+ check_feature('case-module', 'anonyize')
confirmed = self._checkBool(confirmed)
c.context = "../main.mako"
case_bundle = session.get('casebundle')
More information about the Mpuls-commits
mailing list