Source code for waeup.kofa.applicants.permissions

## $Id: 15085 2018-07-11 04:28:32Z henrik $
## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## GNU General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Local permissions for applicants/applications.
import grok

# Application permissions

[docs]class HandleApplication(grok.Permission): """The HandleApplication permission is reserved for applicants. Applicants 'handle' their data. Officers 'manage' the data. """'waeup.handleApplication')
[docs]class ViewApplication(grok.Permission): """The ViewApplication permission allows to view application records. """'waeup.viewApplication')
[docs]class ViewApplicationsTab(grok.Permission):'waeup.viewApplicantsTab')
[docs]class ViewMyApplicationDataTab(grok.Permission):'waeup.viewMyApplicationDataTab')
[docs]class ManageApplication(grok.Permission): """The ManageApplication permission allows to edit the data. This permission is reserved for officers and portal managers. """'waeup.manageApplication')
[docs]class ViewApplicationStatistics(grok.Permission): """The ViewApplicationStatistics permission allows to perform statistical evaluations. """'waeup.viewApplicationStatistics')
[docs]class PayApplicant(grok.Permission): """The PayApplicant permission allows to add an online payment ticket. """'waeup.payApplicant')
[docs]class CreateStudents(grok.Permission): """The CreateStudents permission allows to create a bunch student records from application records. """'waeup.createStudents')
# Local role
[docs]class ApplicationOwner(grok.Role): """An applicant 'owns' her/his application record and gains permissions to handle the record, upload a passport picture or add payment tickets. """'waeup.local.ApplicationOwner') grok.title(u'Application Owner') grok.permissions('waeup.handleApplication', 'waeup.viewApplication', 'waeup.payApplicant')
# Site roles
[docs]class ApplicantRole(grok.Role): """This role is dedicated to applicants only. It defines the permissions an applicant gains portal-wide. """'waeup.Applicant') grok.title(u'Applicant (do not assign)') grok.permissions('waeup.viewAcademics', 'waeup.viewMyApplicationDataTab', 'waeup.Authenticated')
[docs]class ApplicationsOfficer(grok.Role): """The Applications Officer is allowed to view all application records. """'waeup.ApplicationsOfficer') grok.title(u'Applications Officer (view only)') grok.permissions('waeup.viewApplication', 'waeup.viewApplicantsTab')
[docs]class ApplicationsManager(grok.Role): """The Applications Manager is allowed to edit all application records. The role also allows to add payment tickets and view statistics. """'waeup.ApplicationsManager') grok.title(u'Applications Manager') grok.permissions('waeup.manageApplication', 'waeup.viewApplication', 'waeup.viewApplicantsTab', 'waeup.payApplicant', 'waeup.viewApplicationStatistics')
[docs]class StudentsCreator(grok.Role): """The Students Creator is allowed to create a bunch of student records from application records. """'waeup.StudentsCreator') grok.title(u'Students Creator') grok.permissions('waeup.viewApplication', 'waeup.viewApplicantsTab', 'waeup.createStudents')