Changeset 10279 for main/waeup.kofa/trunk
- Timestamp:
- 6 Jun 2013, 05:15:00 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/permissions.py
r10278 r10279 71 71 grok.name('waeup.exportData') 72 72 73 class ExportPaymentsOverview(grok.Permission): 74 grok.name('waeup.exportPaymentsOverview') 75 76 class ExportBursaryData(grok.Permission): 77 grok.name('waeup.exportBursaryData') 78 73 79 class ViewTranscript(grok.Permission): 74 80 grok.name('waeup.viewTranscript') … … 93 99 'waeup.exportData') 94 100 101 class DepartmentOfficer(grok.Role): 102 grok.name('waeup.local.DepartmentOfficer') 103 grok.title(u'Department Officer') 104 grok.permissions('waeup.showStudents', 105 'waeup.viewAcademics', 106 'waeup.exportPaymentsOverview') 107 95 108 class ClearanceOfficer(grok.Role): 96 109 """The clearance officer role is meant for the … … 255 268 grok.name('waeup.BursaryOfficer') 256 269 grok.title(u'Bursary Officer') 257 grok.permissions('waeup.showStudents', 'waeup.viewAcademics') 270 grok.permissions('waeup.showStudents', 271 'waeup.viewAcademics', 272 'waeup.exportBursaryData') 258 273 259 274 class TranscriptOfficer(grok.Role): -
main/waeup.kofa/trunk/src/waeup/kofa/permissions.txt
r10278 r10279 42 42 43 43 >>> len(list(get_waeup_roles(also_local=True))) 44 4 044 41 45 45 46 46 -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r10278 r10279 2961 2961 def _set_exporter_values(self): 2962 2962 # We provide all student exporters, nothing else, yet. 2963 # Bursary Officers don't have the general exportData permission 2964 # and are only allowed to export bursary data. 2963 # Bursary or Department Officers don't have the general exportData 2964 # permission and are only allowed to export bursary or payments 2965 # overview data respectively. This is the only place where 2966 # waeup.exportBursaryData and waeup.exportPaymentsOverview 2967 # are used. 2968 exporters = [] 2965 2969 if not checkPermission('waeup.exportData', self.context): 2966 self.exporters = [('Bursary Data', 'bursary')] 2967 return 2968 exporters = [] 2970 if checkPermission('waeup.exportBursaryData', self.context): 2971 exporters += [('Bursary Data', 'bursary')] 2972 if checkPermission('waeup.exportPaymentsOverview', self.context): 2973 exporters += [('Student Payments Overview', 'paymentsoverview')] 2974 self.exporters = exporters 2975 return 2969 2976 for name in EXPORTER_NAMES: 2970 2977 util = getUtility(ICSVExporter, name=name) -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r10278 r10279 3183 3183 ) 3184 3184 3185 def test_export_departmet_officers(self): 3186 # Create department officer 3187 self.app['users'].addUser('mrdepartment', 'mrdepartmentsecret') 3188 self.app['users']['mrdepartment'].email = 'mrdepartment@foo.ng' 3189 self.app['users']['mrdepartment'].title = 'Carlo Pitter' 3190 # Assign local role 3191 department = self.app['faculties']['fac1']['dep1'] 3192 prmlocal = IPrincipalRoleManager(department) 3193 prmlocal.assignRoleToPrincipal('waeup.local.DepartmentOfficer', 'mrdepartment') 3194 # Login as department officer 3195 self.browser.open(self.login_path) 3196 self.browser.getControl(name="form.login").value = 'mrdepartment' 3197 self.browser.getControl(name="form.password").value = 'mrdepartmentsecret' 3198 self.browser.getControl("Login").click() 3199 self.assertMatches('...You logged in...', self.browser.contents) 3200 self.browser.open("http://localhost/app/faculties/fac1/dep1") 3201 self.browser.getLink("Export student data").click() 3202 self.browser.getControl("Configure new export").click() 3203 # Only the paymentsoverview exporter is available for department officers 3204 self.assertFalse('<option value="students">' in self.browser.contents) 3205 self.assertTrue( 3206 '<option value="paymentsoverview">' in self.browser.contents) 3207 self.browser.getControl(name="exporter").value = ['paymentsoverview'] 3208 self.browser.getControl(name="session").value = ['2004'] 3209 self.browser.getControl(name="level").value = ['100'] 3210 self.browser.getControl("Create CSV file").click() 3211 self.assertTrue('Export started' in self.browser.contents) 3212 # Thew job can be discarded 3213 self.assertEqual(len(self.app['datacenter'].running_exports), 1) 3214 #job_id = self.app['datacenter'].running_exports[0][0] 3215 job_id = self.wait_for_export_job_completed() 3216 self.browser.open("http://localhost/app/faculties/fac1/dep1/exports") 3217 self.browser.getControl("Discard").click() 3218 self.assertEqual(len(self.app['datacenter'].running_exports), 0) 3219 3185 3220 def test_export_bursary_officers(self): 3186 3221 # Create bursary officer -
main/waeup.kofa/trunk/src/waeup/kofa/university/department.py
r10226 r10279 40 40 local_roles = [ 41 41 'waeup.local.ApplicationsManager', 42 'waeup.local.DepartmentOfficer', 42 43 'waeup.local.DepartmentManager', 43 44 'waeup.local.ClearanceOfficer', -
main/waeup.kofa/trunk/src/waeup/kofa/university/facultiescontainer.py
r10247 r10279 25 25 26 26 class VirtualFacultiesExportJobContainer(VirtualExportJobContainer): 27 """A virtual export job container for certificates.27 """A virtual export job container for the faculties container. 28 28 """ 29 29 -
main/waeup.kofa/trunk/src/waeup/kofa/university/faculty.py
r10064 r10279 33 33 34 34 local_roles = [ 35 'waeup.local.DepartmentOfficer', 35 36 'waeup.local.DepartmentManager', 36 37 'waeup.local.ClearanceOfficer',
Note: See TracChangeset for help on using the changeset viewer.