Changeset 13764


Ignore:
Timestamp:
7 Mar 2016, 08:56:46 (9 years ago)
Author:
Henrik Bettermann
Message:

Require waeup.viewStudent for showing students at course level.

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

Legend:

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

    r13617 r13764  
    508508    grok.view(CoursePage)
    509509    grok.name('showcoursestudents')
    510     grok.require('waeup.showStudents')
     510    grok.require('waeup.viewStudent')
    511511    icon = 'actionicon_student.png'
    512512    text = _('Show students')
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r13711 r13764  
    30233023    """
    30243024    grok.context(ICourse)
     3025    grok.require('waeup.viewStudent')
    30253026
    30263027    session_label = _('Session')
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r13711 r13764  
    17931793        self.app['users']['mrslecturer'].email = 'mrslecturer@foo.ng'
    17941794        self.app['users']['mrslecturer'].title = u'Mercedes Benz'
     1795        # Add course ticket
     1796        studylevel = createObject(u'waeup.StudentStudyLevel')
     1797        studylevel.level = 100
     1798        studylevel.level_session = 2004
     1799        self.student['studycourse'].addStudentStudyLevel(
     1800            self.certificate, studylevel)
    17951801        # Assign local Lecturer role for a certificate.
    17961802        course = self.app['faculties']['fac1']['dep1'].courses['COURSE1']
     
    18221828        self.browser.getLink(
    18231829            "http://localhost/app/faculties/fac1/dep1/courses/COURSE1").click()
    1824         # ... and view the list of students
    1825         self.browser.getLink("Show students").click()
    1826         self.browser.getControl(name="session").value = ['2004']
    1827         self.browser.getControl(name="level").value = ['100']
    1828         self.browser.getControl("Show").click()
    1829         self.assertTrue('No student found.' in self.browser.contents)
    1830         # No student in course so far.
    1831         self.assertFalse(self.student_id in self.browser.contents)
    1832         studylevel = createObject(u'waeup.StudentStudyLevel')
    1833         studylevel.level = 100
    1834         studylevel.level_session = 2004
    1835         self.student['studycourse'].addStudentStudyLevel(
    1836             self.certificate, studylevel)
    1837         # Now the student has registered the course and can
    1838         # be seen by the lecturer.
    1839         self.browser.open("http://localhost/app/faculties/fac1/dep1/courses/COURSE1/students")
    1840         self.browser.getControl(name="session").value = ['2004']
    1841         self.browser.getControl(name="level").value = ['100']
    1842         self.browser.getControl("Show").click()
    1843         self.assertTrue(self.student_id in self.browser.contents)
    1844         # Lecturer can neither access the student ...
     1830        # Lecturers can neither filter students ...
     1831        self.assertRaises(
     1832            Unauthorized, self.browser.open,
     1833            "http://localhost/app/faculties/fac1/dep1/courses/COURSE1/students")
     1834        # ... nor access the student ...
    18451835        self.assertRaises(
    18461836            Unauthorized, self.browser.open, self.student_path)
Note: See TracChangeset for help on using the changeset viewer.