1 | ## $Id: permissions.py 12843 2015-04-01 10:51:35Z 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 ViewMyStudentDataTab(grok.Permission): |
---|
32 | grok.name('waeup.viewMyStudentDataTab') |
---|
33 | |
---|
34 | class ViewStudentsContainer(grok.Permission): |
---|
35 | grok.name('waeup.viewStudentsContainer') |
---|
36 | |
---|
37 | class PayStudent(grok.Permission): |
---|
38 | grok.name('waeup.payStudent') |
---|
39 | |
---|
40 | class HandleAccommodation(grok.Permission): |
---|
41 | grok.name('waeup.handleAccommodation') |
---|
42 | |
---|
43 | class UploadStudentFile(grok.Permission): |
---|
44 | grok.name('waeup.uploadStudentFile') |
---|
45 | |
---|
46 | class ManageStudent(grok.Permission): |
---|
47 | grok.name('waeup.manageStudent') |
---|
48 | |
---|
49 | class ClearStudent(grok.Permission): |
---|
50 | grok.name('waeup.clearStudent') |
---|
51 | |
---|
52 | class ValidateStudent(grok.Permission): |
---|
53 | grok.name('waeup.validateStudent') |
---|
54 | |
---|
55 | class EditStudyLevel(grok.Permission): |
---|
56 | grok.name('waeup.editStudyLevel') |
---|
57 | |
---|
58 | class LoginAsStudent(grok.Permission): |
---|
59 | grok.name('waeup.loginAsStudent') |
---|
60 | |
---|
61 | # Local role |
---|
62 | class StudentRecordOwner(grok.Role): |
---|
63 | grok.name('waeup.local.StudentRecordOwner') |
---|
64 | grok.title(u'Student Record Owner') |
---|
65 | grok.permissions('waeup.handleStudent', |
---|
66 | 'waeup.uploadStudentFile', |
---|
67 | 'waeup.viewStudent', |
---|
68 | 'waeup.payStudent', |
---|
69 | 'waeup.handleAccommodation', |
---|
70 | 'waeup.editStudyLevel') |
---|
71 | |
---|
72 | # Site Roles |
---|
73 | class StudentRole(grok.Role): |
---|
74 | grok.name('waeup.Student') |
---|
75 | grok.title(u'Student (do not assign)') |
---|
76 | grok.permissions('waeup.viewAcademics', |
---|
77 | 'waeup.viewMyStudentDataTab', |
---|
78 | 'waeup.Authenticated') |
---|
79 | |
---|
80 | class StudentsOfficer(grok.Role): |
---|
81 | grok.name('waeup.StudentsOfficer') |
---|
82 | grok.title(u'Students Officer (view only)') |
---|
83 | grok.permissions('waeup.viewStudent', |
---|
84 | 'waeup.viewStudentsContainer') |
---|
85 | |
---|
86 | class StudentsManager(grok.Role): |
---|
87 | grok.name('waeup.StudentsManager') |
---|
88 | grok.title(u'Students Manager') |
---|
89 | grok.permissions('waeup.viewStudent', |
---|
90 | 'waeup.manageStudent', |
---|
91 | 'waeup.viewStudentsContainer', |
---|
92 | 'waeup.payStudent', |
---|
93 | 'waeup.uploadStudentFile', |
---|
94 | 'waeup.handleAccommodation') |
---|
95 | |
---|
96 | class TranscriptOfficer(grok.Role): |
---|
97 | grok.name('waeup.TranscriptOfficer') |
---|
98 | grok.title(u'Transcript Officer') |
---|
99 | grok.permissions('waeup.viewAcademics', |
---|
100 | 'waeup.viewTranscript', |
---|
101 | 'waeup.viewStudent', |
---|
102 | 'waeup.viewStudentsContainer', |
---|
103 | ) |
---|
104 | |
---|
105 | class StudentsClearanceOfficer(grok.Role): |
---|
106 | grok.name('waeup.StudentsClearanceOfficer') |
---|
107 | grok.title(u'Clearance Officer (all students)') |
---|
108 | grok.permissions('waeup.clearStudent', |
---|
109 | 'waeup.viewStudent') |
---|
110 | |
---|
111 | class StudentsCourseAdviser(grok.Role): |
---|
112 | grok.name('waeup.StudentsCourseAdviser') |
---|
113 | grok.title(u'Course Adviser (all students)') |
---|
114 | grok.permissions('waeup.validateStudent', |
---|
115 | 'waeup.viewStudent', |
---|
116 | 'waeup.editStudyLevel') |
---|
117 | |
---|
118 | class StudentImpersonator(grok.Role): |
---|
119 | grok.name('waeup.StudentImpersonator') |
---|
120 | grok.title(u'Student Impersonator') |
---|
121 | grok.permissions('waeup.loginAsStudent') |
---|