Changeset 17423


Ignore:
Timestamp:
27 May 2023, 07:36:53 (18 months ago)
Author:
Henrik Bettermann
Message:

Disable data exports and reports except for user amadin.

Location:
main/waeup.aaue/trunk/src/waeup/aaue
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/browser/pages.py

    r13395 r17423  
    2020    SessionConfigurationAddFormPage,
    2121    SessionConfigurationManageFormPage,
    22     ConfigurationContainerManageFormPage)
     22    ConfigurationContainerManageFormPage,
     23    DatacenterPage, ExportCSVPage)
     24from waeup.kofa.browser.reports import ReportsContainerPage
    2325from waeup.kofa.interfaces import IConfigurationContainer
    2426from waeup.aaue.interfaces import (
     
    4345    """
    4446    form_fields = grok.AutoFields(ICustomSessionConfiguration)
     47
     48# Temporarily disable data export
     49
     50class CustomExportCSVPage(ExportCSVPage):
     51
     52    def update(self):
     53        if self.request.principal.id not in (
     54            'admin', 'zope.manager', 'zope.mgr', 'amadin'):
     55            self.flash('Data export has been temporarily disabled.',
     56                       type='warning')
     57            return self.redirect(self.url(self.context))
     58        return super(CustomExportCSVPage,self).update()
     59
     60class CustomReportsContainerPage(ReportsContainerPage):
     61
     62    def update(self):
     63        if self.request.principal.id not in (
     64            'admin', 'zope.managers', 'zope.mgrs', 'amadin'):
     65            self.flash('Reports have been temporarily disabled.',
     66                       type='warning')
     67            return self.redirect(self.application_url())
     68        return super(CustomReportsContainerPage,self).update()
Note: See TracChangeset for help on using the changeset viewer.