source: main/waeup.sirp/trunk/src/waeup/sirp/students/permissions.py @ 7247

Last change on this file since 7247 was 7240, checked in by Henrik Bettermann, 13 years ago

Rebuild applicants package (1st part). Applicants now have an applicant_id and a password and can use the regular login page to enter the portal.

Add user_type attribute to SIRPPrincipal objects.

Add some permissions in students package.

Some tests are still missing and will be re-added soon.

  • Property svn:keywords set to Id
File size: 2.9 KB
Line 
1## $Id: permissions.py 7240 2011-11-30 23:13:26Z 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"""
19Permissions for the student section.
20"""
21import grok
22
23# Student section permissions
24
25class HandleStudent(grok.Permission):
26    grok.name('waeup.handleStudent')
27
28class ViewStudent(grok.Permission):
29    grok.name('waeup.viewStudent')
30
31class ViewStudentsTab(grok.Permission):
32    grok.name('waeup.viewStudentsTab')
33
34class ViewMyStudentDataTab(grok.Permission):
35    grok.name('waeup.viewMyStudentDataTab')
36
37class ViewStudentsContainer(grok.Permission):
38    grok.name('waeup.viewStudentsContainer')
39
40class PayStudent(grok.Permission):
41    grok.name('waeup.payStudent')
42
43class HandleAccommodation(grok.Permission):
44    grok.name('waeup.handleAccommodation')
45
46class UploadStudentFile(grok.Permission):
47    grok.name('waeup.uploadStudentFile')
48
49class ManageStudent(grok.Permission):
50    grok.name('waeup.manageStudent')
51
52class ClearStudent(grok.Permission):
53    grok.name('waeup.clearStudent')
54
55# Local role
56class StudentRecordOwner(grok.Role):
57    grok.name('waeup.local.StudentRecordOwner')
58    grok.title(u'Student Record Owner')
59    grok.permissions('waeup.handleStudent', 'waeup.uploadStudentFile',
60                     'waeup.viewStudent', 'waeup.payStudent',
61                     'waeup.handleAccommodation', 'waeup.Authenticated')
62
63# Site Roles
64class StudentRole(grok.Role):
65    grok.name('waeup.Student')
66    grok.permissions('waeup.viewAcademics', 'waeup.viewMyStudentDataTab')
67
68class StudentsOfficer(grok.Role):
69    grok.name('waeup.StudentsOfficer')
70    grok.title(u'Students Officer (view only)')
71    grok.permissions('waeup.viewStudent','waeup.viewStudents',
72          'waeup.viewStudentsTab', 'waeup.viewStudentsContainer')
73
74class StudentsManager(grok.Role):
75    grok.name('waeup.StudentsManager')
76    grok.title(u'Students Manager')
77    grok.permissions('waeup.viewStudent', 'waeup.manageStudent',
78                     'waeup.payStudent', 'waeup.uploadStudentFile',
79                     'waeup.handleAccommodation', 'waeup.viewStudents')
80
81class StudentsClearanceOfficer(grok.Role):
82    grok.name('waeup.StudentsClearanceOfficer')
83    grok.title(u'Clearance Officer (all students)')
84    grok.permissions('waeup.clearStudent','waeup.viewStudent')
Note: See TracBrowser for help on using the repository browser.