1 | ## $Id: student_payment_statistics.py 14466 2017-01-26 15:03:56Z henrik $ |
---|
2 | ## |
---|
3 | ## Copyright (C) 2016 Uli Fouquet & Henrik Bettermann |
---|
4 | ## This program is free software; you can redistribute it and/or modify |
---|
5 | ## it under the terms of the GNU General Public License as published by |
---|
6 | ## the Free Software Foundation; either version 2 of the License, or |
---|
7 | ## (at your option) any later version. |
---|
8 | ## |
---|
9 | ## This program is distributed in the hope that it will be useful, |
---|
10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | ## GNU General Public License for more details. |
---|
13 | ## |
---|
14 | ## You should have received a copy of the GNU General Public License |
---|
15 | ## along with this program; if not, write to the Free Software |
---|
16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
17 | ## |
---|
18 | |
---|
19 | import grok |
---|
20 | from zope.securitypolicy.interfaces import IPrincipalRoleManager |
---|
21 | from waeup.kofa.students.reports.student_payment_statistics import ( |
---|
22 | StudentPaymentStatisticsReportGeneratorPage,) |
---|
23 | |
---|
24 | |
---|
25 | class CustomStudentPaymentStatisticsReportGeneratorPage( |
---|
26 | StudentPaymentStatisticsReportGeneratorPage): |
---|
27 | |
---|
28 | def update( |
---|
29 | self, CREATE=None, session=None, mode=None, level=None, breakdown=None): |
---|
30 | |
---|
31 | if not self.request.principal.id in ('admin', 'isouaba', 'zope.manager'): |
---|
32 | self.flash('Temporarily disabled.', type='warning') |
---|
33 | self.redirect(self.url(self.context.__parent__)) |
---|
34 | return |
---|
35 | super(CustomStudentPaymentStatisticsReportGeneratorPage, self).update( |
---|
36 | CREATE, session, mode, level, breakdown) |
---|
37 | return |
---|