[7191] | 1 | ## $Id: permissions.py 9924 2013-01-30 08:58:37Z henrik $ |
---|
| 2 | ## |
---|
[6655] | 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 | |
---|
[6660] | 25 | class HandleStudent(grok.Permission): |
---|
| 26 | grok.name('waeup.handleStudent') |
---|
[6655] | 27 | |
---|
[6660] | 28 | class ViewStudent(grok.Permission): |
---|
| 29 | grok.name('waeup.viewStudent') |
---|
| 30 | |
---|
[7240] | 31 | class ViewStudentsTab(grok.Permission): |
---|
| 32 | grok.name('waeup.viewStudentsTab') |
---|
[7184] | 33 | |
---|
[7240] | 34 | class ViewMyStudentDataTab(grok.Permission): |
---|
| 35 | grok.name('waeup.viewMyStudentDataTab') |
---|
| 36 | |
---|
| 37 | class ViewStudentsContainer(grok.Permission): |
---|
| 38 | grok.name('waeup.viewStudentsContainer') |
---|
| 39 | |
---|
[6930] | 40 | class PayStudent(grok.Permission): |
---|
| 41 | grok.name('waeup.payStudent') |
---|
| 42 | |
---|
[7181] | 43 | class HandleAccommodation(grok.Permission): |
---|
| 44 | grok.name('waeup.handleAccommodation') |
---|
| 45 | |
---|
[7127] | 46 | class UploadStudentFile(grok.Permission): |
---|
| 47 | grok.name('waeup.uploadStudentFile') |
---|
| 48 | |
---|
[7136] | 49 | class ManageStudent(grok.Permission): |
---|
| 50 | grok.name('waeup.manageStudent') |
---|
[6655] | 51 | |
---|
[7136] | 52 | class ClearStudent(grok.Permission): |
---|
| 53 | grok.name('waeup.clearStudent') |
---|
| 54 | |
---|
[7334] | 55 | class ValidateStudent(grok.Permission): |
---|
| 56 | grok.name('waeup.validateStudent') |
---|
| 57 | |
---|
[9924] | 58 | class EditStudyLevel(grok.Permission): |
---|
| 59 | grok.name('waeup.editStudyLevel') |
---|
| 60 | |
---|
[9273] | 61 | class TriggerTransition(grok.Permission): |
---|
| 62 | grok.name('waeup.triggerTransition') |
---|
| 63 | |
---|
[9335] | 64 | class LoginAsStudent(grok.Permission): |
---|
| 65 | grok.name('waeup.loginAsStudent') |
---|
| 66 | |
---|
[6660] | 67 | # Local role |
---|
| 68 | class StudentRecordOwner(grok.Role): |
---|
| 69 | grok.name('waeup.local.StudentRecordOwner') |
---|
| 70 | grok.title(u'Student Record Owner') |
---|
[7127] | 71 | grok.permissions('waeup.handleStudent', 'waeup.uploadStudentFile', |
---|
[7181] | 72 | 'waeup.viewStudent', 'waeup.payStudent', |
---|
[9924] | 73 | 'waeup.handleAccommodation', 'waeup.editStudyLevel') |
---|
[6660] | 74 | |
---|
[7178] | 75 | # Site Roles |
---|
[6678] | 76 | class StudentRole(grok.Role): |
---|
| 77 | grok.name('waeup.Student') |
---|
[8367] | 78 | grok.permissions('waeup.viewAcademics', 'waeup.viewMyStudentDataTab', |
---|
| 79 | 'waeup.Authenticated') |
---|
[6678] | 80 | |
---|
[6655] | 81 | class StudentsOfficer(grok.Role): |
---|
| 82 | grok.name('waeup.StudentsOfficer') |
---|
[7154] | 83 | grok.title(u'Students Officer (view only)') |
---|
[7240] | 84 | grok.permissions('waeup.viewStudent','waeup.viewStudents', |
---|
| 85 | 'waeup.viewStudentsTab', 'waeup.viewStudentsContainer') |
---|
[7154] | 86 | |
---|
| 87 | class StudentsManager(grok.Role): |
---|
| 88 | grok.name('waeup.StudentsManager') |
---|
| 89 | grok.title(u'Students Manager') |
---|
[8367] | 90 | grok.permissions('waeup.viewStudent', 'waeup.viewStudents', |
---|
| 91 | 'waeup.manageStudent', 'waeup.viewStudentsContainer', |
---|
[7181] | 92 | 'waeup.payStudent', 'waeup.uploadStudentFile', |
---|
[8367] | 93 | 'waeup.viewStudentsTab', 'waeup.handleAccommodation') |
---|
[7154] | 94 | |
---|
| 95 | class StudentsClearanceOfficer(grok.Role): |
---|
| 96 | grok.name('waeup.StudentsClearanceOfficer') |
---|
| 97 | grok.title(u'Clearance Officer (all students)') |
---|
[7334] | 98 | grok.permissions('waeup.clearStudent','waeup.viewStudent') |
---|
| 99 | |
---|
| 100 | class StudentsCourseAdviser(grok.Role): |
---|
| 101 | grok.name('waeup.StudentsCourseAdviser') |
---|
| 102 | grok.title(u'Course Adviser (all students)') |
---|
[9924] | 103 | grok.permissions('waeup.validateStudent','waeup.viewStudent', |
---|
| 104 | 'waeup.editStudyLevel') |
---|
[9335] | 105 | |
---|
| 106 | class StudentImpersonator(grok.Role): |
---|
| 107 | grok.name('waeup.StudentImpersonator') |
---|
| 108 | grok.title(u'Student Impersonator') |
---|
| 109 | grok.permissions('waeup.loginAsStudent') |
---|