[7191] | 1 | ## $Id: permissions.py 7201 2011-11-25 14:25:43Z 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 | |
---|
[7184] | 31 | class ViewStudents(grok.Permission): |
---|
| 32 | grok.name('waeup.viewStudents') |
---|
| 33 | |
---|
[6930] | 34 | class PayStudent(grok.Permission): |
---|
| 35 | grok.name('waeup.payStudent') |
---|
| 36 | |
---|
[7181] | 37 | class HandleAccommodation(grok.Permission): |
---|
| 38 | grok.name('waeup.handleAccommodation') |
---|
| 39 | |
---|
[7127] | 40 | class UploadStudentFile(grok.Permission): |
---|
| 41 | grok.name('waeup.uploadStudentFile') |
---|
| 42 | |
---|
[7136] | 43 | class ManageStudent(grok.Permission): |
---|
| 44 | grok.name('waeup.manageStudent') |
---|
[6655] | 45 | |
---|
[7136] | 46 | class ClearStudent(grok.Permission): |
---|
| 47 | grok.name('waeup.clearStudent') |
---|
| 48 | |
---|
[6660] | 49 | # Local role |
---|
| 50 | class StudentRecordOwner(grok.Role): |
---|
| 51 | grok.name('waeup.local.StudentRecordOwner') |
---|
| 52 | grok.title(u'Student Record Owner') |
---|
[7127] | 53 | grok.permissions('waeup.handleStudent', 'waeup.uploadStudentFile', |
---|
[7181] | 54 | 'waeup.viewStudent', 'waeup.payStudent', |
---|
[7184] | 55 | 'waeup.handleAccommodation', 'waeup.Authenticated') |
---|
[6660] | 56 | |
---|
[7178] | 57 | # Site Roles |
---|
[6678] | 58 | class StudentRole(grok.Role): |
---|
| 59 | grok.name('waeup.Student') |
---|
[7184] | 60 | grok.permissions('waeup.viewAcademics') |
---|
[6678] | 61 | |
---|
[6655] | 62 | class StudentsOfficer(grok.Role): |
---|
| 63 | grok.name('waeup.StudentsOfficer') |
---|
[7154] | 64 | grok.title(u'Students Officer (view only)') |
---|
[7184] | 65 | grok.permissions('waeup.viewStudent','waeup.viewStudents') |
---|
[7154] | 66 | |
---|
| 67 | class StudentsManager(grok.Role): |
---|
| 68 | grok.name('waeup.StudentsManager') |
---|
| 69 | grok.title(u'Students Manager') |
---|
[7168] | 70 | grok.permissions('waeup.viewStudent', 'waeup.manageStudent', |
---|
[7181] | 71 | 'waeup.payStudent', 'waeup.uploadStudentFile', |
---|
[7184] | 72 | 'waeup.handleAccommodation', 'waeup.viewStudents') |
---|
[7154] | 73 | |
---|
| 74 | class StudentsClearanceOfficer(grok.Role): |
---|
| 75 | grok.name('waeup.StudentsClearanceOfficer') |
---|
| 76 | grok.title(u'Clearance Officer (all students)') |
---|
[7201] | 77 | grok.permissions('waeup.clearStudent','waeup.viewStudent') |
---|