[Mpuls-commits] r5370 - base/trunk/mpulsweb/controllers
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Sep 19 17:00:10 CEST 2011
Author: torsten
Date: 2011-09-19 17:00:10 +0200 (Mon, 19 Sep 2011)
New Revision: 5370
Modified:
base/trunk/mpulsweb/controllers/case_bundle.py
Log:
Use new checkFeature function to disable export if parts or the whole export
is not enabled in the mpuls_config.
Modified: base/trunk/mpulsweb/controllers/case_bundle.py
===================================================================
--- base/trunk/mpulsweb/controllers/case_bundle.py 2011-09-19 14:57:27 UTC (rev 5369)
+++ base/trunk/mpulsweb/controllers/case_bundle.py 2011-09-19 15:00:10 UTC (rev 5370)
@@ -12,7 +12,7 @@
from mpulsweb.lib.translation import _, ungettext
from mpulsweb.lib.base import c, render, request, session, BaseController
from mpulsweb.lib.helpers import url_for
-from mpulsweb.lib.security import checkRole
+from mpulsweb.lib.security import checkRole, checkFeature
from mpulsweb.lib.validators import BundleActionForm, SetBundleEditorForm, \
SetBundleStandinForm, ExportSelectorValidator
from mpulsweb.lib.helper.filters import NA
@@ -597,6 +597,8 @@
# EXPORT
def export(self, type="XML"):
+ # check if feature is enabled or raise execption
+ checkFeature('case-module', 'export%s' % type)
c.context = "../main.mako"
case_bundle = session.get('casebundle')
# only pages that are not invisible can be selected by the user.
@@ -625,6 +627,8 @@
case_bundle = session.get('casebundle')
form_result = validator.to_python(request.params)
exporttype = form_result.get('exporttype')
+ # check if feature is enabled or raise execption
+ checkFeature('case-module', 'export%s' % exporttype)
exportanonym = form_result.get('exportanonym')
exportselection = form_result.get('exportselection')
num, export = case_bundle.export(exporttype,
More information about the Mpuls-commits
mailing list