source: main/waeup.kofa/trunk/src/waeup/kofa/applicants/permissions.py @ 14542

Last change on this file since 14542 was 14511, checked in by Henrik Bettermann, 8 years ago

Add officer name fields do IDepartment and IFaculty. Plugins must be updated!

  • Property svn:keywords set to Id
File size: 3.5 KB
Line 
1## $Id: permissions.py 14511 2017-02-07 08:33:05Z henrik $
2##
3## Copyright (C) 2011 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"""
19Local permissions for applicants/applications.
20"""
21import grok
22
23# Application permissions
24
25class HandleApplication(grok.Permission):
26    """The HandleApplication permission is reserved for applicants.
27    Applicants 'handle' their data. Officers 'manage' the data.
28    """
29    grok.name('waeup.handleApplication')
30
31class ViewApplication(grok.Permission):
32    """The ViewApplication permission allows to view application records.
33    """
34    grok.name('waeup.viewApplication')
35
36class ViewApplicationsTab(grok.Permission):
37    grok.name('waeup.viewApplicantsTab')
38
39class ViewMyApplicationDataTab(grok.Permission):
40    grok.name('waeup.viewMyApplicationDataTab')
41
42class ManageApplication(grok.Permission):
43    """The ManageApplication permission allows to edit the data. This
44    permission is reserved for officers and portal managers.
45    """
46    grok.name('waeup.manageApplication')
47
48class ViewApplicationStatistics(grok.Permission):
49    """The ViewApplicationStatistics permission allows to perform statistical
50    evaluations. Only portal managers have this permission.
51    """
52    grok.name('waeup.viewApplicationStatistics')
53
54class PayApplicant(grok.Permission):
55    """The PayApplicant permission allows to add an online payment ticket.
56    """
57    grok.name('waeup.payApplicant')
58
59# Local role
60
61class ApplicationOwner(grok.Role):
62    """An applicant 'owns' her/his application record and
63    gains permissions to handle the record, upload a passport picture or
64    add payment tickets.
65    """
66    grok.name('waeup.local.ApplicationOwner')
67    grok.title(u'Application Owner')
68    grok.permissions('waeup.handleApplication',
69                     'waeup.viewApplication',
70                     'waeup.payApplicant')
71
72# Site roles
73
74class ApplicantRole(grok.Role):
75    """This role is dedicated to applicants only. It defines the permissions
76    an applicant gains portal-wide.
77    """
78    grok.name('waeup.Applicant')
79    grok.title(u'Applicant (do not assign)')
80    grok.permissions('waeup.viewAcademics', 'waeup.viewMyApplicationDataTab',
81                     'waeup.Authenticated')
82
83class ApplicationsOfficer(grok.Role):
84    """The Applications Officer is allowed to view all application records.
85    """
86    grok.name('waeup.ApplicationsOfficer')
87    grok.title(u'Applications Officer (view only)')
88    grok.permissions('waeup.viewApplication', 'waeup.viewApplicantsTab')
89
90class ApplicationsManager(grok.Role):
91    """The Applications Manager is allowed to edit all application records.
92    The role also allows to add payment tickets.
93    """
94    grok.name('waeup.ApplicationsManager')
95    grok.title(u'Applications Manager')
96    grok.permissions('waeup.manageApplication', 'waeup.viewApplication',
97                     'waeup.viewApplicantsTab', 'waeup.payApplicant')
Note: See TracBrowser for help on using the repository browser.