1 | ## $Id: permissions.py 8367 2012-05-06 11:19:38Z 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 | """ |
---|
19 | Permissions for the student section. |
---|
20 | """ |
---|
21 | import grok |
---|
22 | |
---|
23 | # Student section permissions |
---|
24 | |
---|
25 | class HandleStudent(grok.Permission): |
---|
26 | grok.name('waeup.handleStudent') |
---|
27 | |
---|
28 | class ViewStudent(grok.Permission): |
---|
29 | grok.name('waeup.viewStudent') |
---|
30 | |
---|
31 | class ViewStudentsTab(grok.Permission): |
---|
32 | grok.name('waeup.viewStudentsTab') |
---|
33 | |
---|
34 | class ViewMyStudentDataTab(grok.Permission): |
---|
35 | grok.name('waeup.viewMyStudentDataTab') |
---|
36 | |
---|
37 | class ViewStudentsContainer(grok.Permission): |
---|
38 | grok.name('waeup.viewStudentsContainer') |
---|
39 | |
---|
40 | class PayStudent(grok.Permission): |
---|
41 | grok.name('waeup.payStudent') |
---|
42 | |
---|
43 | class HandleAccommodation(grok.Permission): |
---|
44 | grok.name('waeup.handleAccommodation') |
---|
45 | |
---|
46 | class UploadStudentFile(grok.Permission): |
---|
47 | grok.name('waeup.uploadStudentFile') |
---|
48 | |
---|
49 | class ManageStudent(grok.Permission): |
---|
50 | grok.name('waeup.manageStudent') |
---|
51 | |
---|
52 | class ClearStudent(grok.Permission): |
---|
53 | grok.name('waeup.clearStudent') |
---|
54 | |
---|
55 | class ValidateStudent(grok.Permission): |
---|
56 | grok.name('waeup.validateStudent') |
---|
57 | |
---|
58 | # Local role |
---|
59 | class StudentRecordOwner(grok.Role): |
---|
60 | grok.name('waeup.local.StudentRecordOwner') |
---|
61 | grok.title(u'Student Record Owner') |
---|
62 | grok.permissions('waeup.handleStudent', 'waeup.uploadStudentFile', |
---|
63 | 'waeup.viewStudent', 'waeup.payStudent', |
---|
64 | 'waeup.handleAccommodation') |
---|
65 | |
---|
66 | # Site Roles |
---|
67 | class StudentRole(grok.Role): |
---|
68 | grok.name('waeup.Student') |
---|
69 | grok.permissions('waeup.viewAcademics', 'waeup.viewMyStudentDataTab', |
---|
70 | 'waeup.Authenticated') |
---|
71 | |
---|
72 | class StudentsOfficer(grok.Role): |
---|
73 | grok.name('waeup.StudentsOfficer') |
---|
74 | grok.title(u'Students Officer (view only)') |
---|
75 | grok.permissions('waeup.viewStudent','waeup.viewStudents', |
---|
76 | 'waeup.viewStudentsTab', 'waeup.viewStudentsContainer') |
---|
77 | |
---|
78 | class StudentsManager(grok.Role): |
---|
79 | grok.name('waeup.StudentsManager') |
---|
80 | grok.title(u'Students Manager') |
---|
81 | grok.permissions('waeup.viewStudent', 'waeup.viewStudents', |
---|
82 | 'waeup.manageStudent', 'waeup.viewStudentsContainer', |
---|
83 | 'waeup.payStudent', 'waeup.uploadStudentFile', |
---|
84 | 'waeup.viewStudentsTab', 'waeup.handleAccommodation') |
---|
85 | |
---|
86 | class StudentsClearanceOfficer(grok.Role): |
---|
87 | grok.name('waeup.StudentsClearanceOfficer') |
---|
88 | grok.title(u'Clearance Officer (all students)') |
---|
89 | grok.permissions('waeup.clearStudent','waeup.viewStudent') |
---|
90 | |
---|
91 | class StudentsCourseAdviser(grok.Role): |
---|
92 | grok.name('waeup.StudentsCourseAdviser') |
---|
93 | grok.title(u'Course Adviser (all students)') |
---|
94 | grok.permissions('waeup.validateStudent','waeup.viewStudent') |
---|