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

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

Implement local CourseAdviser? roles. These roles can be assigned in departments and certificates. There are 6 different roles, one for each study level. getRolesForPrincipal grants the additional waeup.StudentsCourseAdviser? role only if the current level of a student corresponds with the level number in the external role name.

To do: Assign local roles on CertificateManageFormPage?. Add browser tests.

  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1## $Id: permissions.py 7334 2011-12-12 14:11:21Z 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
55class ValidateStudent(grok.Permission):
56    grok.name('waeup.validateStudent')
57
58# Local role
59class 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', 'waeup.Authenticated')
65
66# Site Roles
67class StudentRole(grok.Role):
68    grok.name('waeup.Student')
69    grok.permissions('waeup.viewAcademics', 'waeup.viewMyStudentDataTab')
70
71class StudentsOfficer(grok.Role):
72    grok.name('waeup.StudentsOfficer')
73    grok.title(u'Students Officer (view only)')
74    grok.permissions('waeup.viewStudent','waeup.viewStudents',
75          'waeup.viewStudentsTab', 'waeup.viewStudentsContainer')
76
77class StudentsManager(grok.Role):
78    grok.name('waeup.StudentsManager')
79    grok.title(u'Students Manager')
80    grok.permissions('waeup.viewStudent', 'waeup.manageStudent',
81                     'waeup.payStudent', 'waeup.uploadStudentFile',
82                     'waeup.handleAccommodation', 'waeup.viewStudents')
83
84class StudentsClearanceOfficer(grok.Role):
85    grok.name('waeup.StudentsClearanceOfficer')
86    grok.title(u'Clearance Officer (all students)')
87    grok.permissions('waeup.clearStudent','waeup.viewStudent')
88
89class StudentsCourseAdviser(grok.Role):
90    grok.name('waeup.StudentsCourseAdviser')
91    grok.title(u'Course Adviser (all students)')
92    grok.permissions('waeup.validateStudent','waeup.viewStudent')
Note: See TracBrowser for help on using the repository browser.