Changeset 10248


Ignore:
Timestamp:
29 May 2013, 06:46:54 (11 years ago)
Author:
Henrik Bettermann
Message:

Bursary Officers are only allowed to export bursary data at all levels in academics.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/permissions.py

    r10246 r10248  
    8686    grok.name('waeup.local.DepartmentManager')
    8787    grok.title(u'Department Manager')
    88     grok.permissions('waeup.manageAcademics','waeup.showStudents')
     88    grok.permissions('waeup.manageAcademics',
     89                     'waeup.showStudents',
     90                     'waeup.exportData')
    8991
    9092class ClearanceOfficer(grok.Role):
     
    9496    grok.name('waeup.local.ClearanceOfficer')
    9597    grok.title(u'Clearance Officer')
    96     grok.permissions('waeup.showStudents', 'waeup.viewAcademics')
     98    grok.permissions('waeup.showStudents',
     99                     'waeup.viewAcademics',
     100                     'waeup.exportData')
    97101
    98102class UGClearanceOfficer(grok.Role):
     
    102106    grok.name('waeup.local.UGClearanceOfficer')
    103107    grok.title(u'UG Clearance Officer')
    104     grok.permissions('waeup.showStudents', 'waeup.viewAcademics')
     108    grok.permissions('waeup.showStudents',
     109                     'waeup.viewAcademics',
     110                     'waeup.exportData')
    105111
    106112class PGClearanceOfficer(grok.Role):
     
    110116    grok.name('waeup.local.PGClearanceOfficer')
    111117    grok.title(u'PG Clearance Officer')
    112     grok.permissions('waeup.showStudents', 'waeup.viewAcademics')
     118    grok.permissions('waeup.showStudents',
     119                     'waeup.viewAcademics',
     120                     'waeup.exportData')
    113121
    114122class CourseAdviser100(grok.Role):
     
    118126    grok.name('waeup.local.CourseAdviser100')
    119127    grok.title(u'Course Adviser 100L')
    120     grok.permissions('waeup.showStudents', 'waeup.viewAcademics')
     128    grok.permissions('waeup.showStudents',
     129                     'waeup.viewAcademics',
     130                     'waeup.exportData')
    121131
    122132class CourseAdviser200(grok.Role):
     
    126136    grok.name('waeup.local.CourseAdviser200')
    127137    grok.title(u'Course Adviser 200L')
    128     grok.permissions('waeup.showStudents', 'waeup.viewAcademics')
     138    grok.permissions('waeup.showStudents',
     139                     'waeup.viewAcademics',
     140                     'waeup.exportData')
    129141
    130142class CourseAdviser300(grok.Role):
     
    134146    grok.name('waeup.local.CourseAdviser300')
    135147    grok.title(u'Course Adviser 300L')
    136     grok.permissions('waeup.showStudents', 'waeup.viewAcademics')
     148    grok.permissions('waeup.showStudents',
     149                     'waeup.viewAcademics',
     150                     'waeup.exportData')
    137151
    138152class CourseAdviser400(grok.Role):
     
    142156    grok.name('waeup.local.CourseAdviser400')
    143157    grok.title(u'Course Adviser 400L')
    144     grok.permissions('waeup.showStudents', 'waeup.viewAcademics')
     158    grok.permissions('waeup.showStudents',
     159                     'waeup.viewAcademics',
     160                     'waeup.exportData')
    145161
    146162class CourseAdviser500(grok.Role):
     
    150166    grok.name('waeup.local.CourseAdviser500')
    151167    grok.title(u'Course Adviser 500L')
    152     grok.permissions('waeup.showStudents', 'waeup.viewAcademics')
     168    grok.permissions('waeup.showStudents',
     169                     'waeup.viewAcademics',
     170                     'waeup.exportData')
    153171
    154172class CourseAdviser600(grok.Role):
     
    158176    grok.name('waeup.local.CourseAdviser600')
    159177    grok.title(u'Course Adviser 600L')
    160     grok.permissions('waeup.showStudents', 'waeup.viewAcademics')
     178    grok.permissions('waeup.showStudents',
     179                     'waeup.viewAcademics',
     180                     'waeup.exportData')
    161181
    162182class CourseAdviser700(grok.Role):
     
    166186    grok.name('waeup.local.CourseAdviser700')
    167187    grok.title(u'Course Adviser 700L')
    168     grok.permissions('waeup.showStudents', 'waeup.viewAcademics')
     188    grok.permissions('waeup.showStudents',
     189                     'waeup.viewAcademics',
     190                     'waeup.exportData')
    169191
    170192class CourseAdviser800(grok.Role):
     
    174196    grok.name('waeup.local.CourseAdviser800')
    175197    grok.title(u'Course Adviser 800L')
    176     grok.permissions('waeup.showStudents', 'waeup.viewAcademics')
     198    grok.permissions('waeup.showStudents',
     199                     'waeup.viewAcademics',
     200                     'waeup.exportData')
    177201
    178202class Lecturer(grok.Role):
     
    182206    grok.name('waeup.local.Lecturer')
    183207    grok.title(u'Lecturer')
    184     grok.permissions('waeup.showStudents', 'waeup.viewAcademics')
     208    grok.permissions('waeup.showStudents',
     209                     'waeup.viewAcademics',
     210                     'waeup.exportData')
    185211
    186212class Owner(grok.Role):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r10247 r10248  
    28752875    def _set_exporter_values(self):
    28762876        # We provide all student exporters, nothing else, yet.
     2877        # Bursary Officers don't have the general exportData permission
     2878        # and are only allowed to export bursary data.
     2879        if not checkPermission('waeup.exportData', self.context):
     2880            self.exporters = [('Bursary Data', 'bursary')]
     2881            return
    28772882        exporters = []
    28782883        for name in EXPORTER_NAMES:
     
    29472952    """
    29482953    grok.context(VirtualFacultiesExportJobContainer)
    2949 
    2950     def _set_exporter_values(self):
    2951         # Only Bursary Officers will use this export. They must
    2952         # not be allowed to export regular student data at faculties level
    2953         self.exporters = [('Bursary Data', 'bursary')]
    2954         return
    29552954
    29562955class DepartmentExportJobContainerJobConfig(ExportJobContainerJobConfig):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r10247 r10248  
    28862886        self.browser.getControl("Configure new export").click()
    28872887        # Only the bursary exporter us available ot this level
    2888         self.assertFalse('<option value="students">' in self.browser.contents)
    2889         self.assertTrue('<option value="bursary">' in self.browser.contents)
     2888        #self.assertFalse('<option value="students">' in self.browser.contents)
     2889        #self.assertTrue('<option value="bursary">' in self.browser.contents)
    28902890        self.browser.getControl(name="exporter").value = ['bursary']
    28912891        self.browser.getControl(name="session").value = ['2004']
Note: See TracChangeset for help on using the changeset viewer.