Index: main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py	(revision 9563)
+++ main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py	(revision 9565)
@@ -62,4 +62,5 @@
 
 from waeup.kofa.students.catalog import search as searchstudents
+from waeup.kofa.students.catalog import StudentQueryResultItem
 from waeup.kofa.university.catalog import search
 from waeup.kofa.university.vocabularies import course_levels
@@ -1890,8 +1891,5 @@
     """
     grok.context(ICertificate)
-    grok.require('waeup.showStudents')
     grok.name('showcertstudents')
-    pnav = 1
-    label = _('Students')
 
     @property
@@ -1899,4 +1897,19 @@
         hitlist = searchstudents(query=self.context.code,
             searchtype='certcode', view=self)
+        return hitlist
+
+class ShowStudentsInCoursePage(ShowStudentsInDepartmentPage):
+    """Page that lists all students studying a certificate.
+    """
+    grok.context(ICourse)
+    grok.name('showcoursestudents')
+
+    @property
+    def getStudents(self):
+        hitlist = []
+        cat = queryUtility(ICatalog, name='coursetickets_catalog')
+        results = cat.searchResults(code=(self.context.code, self.context.code))
+        for result in results:
+            hitlist.append(StudentQueryResultItem(result.student, view=self))
         return hitlist
 
Index: main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py	(revision 9563)
+++ main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py	(revision 9565)
@@ -452,4 +452,14 @@
     text = _('Manage certificate')
 
+class ShowCourseStudentsActionButton(ManageActionButton):
+    """ 'Show students' button in course.
+    """
+    grok.context(ICourse)
+    grok.view(CoursePage)
+    grok.require('waeup.showStudents')
+    icon = 'actionicon_student.png'
+    text = _('Show students')
+    target = 'showcoursestudents'
+
 class ShowCertificateStudentsActionButton(ManageActionButton):
     """ 'Show students' button for certificates.
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/dynamicroles.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/dynamicroles.py	(revision 9563)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/dynamicroles.py	(revision 9565)
@@ -29,10 +29,8 @@
 from waeup.kofa.students.interfaces import IStudent
 
-# All components in here have the same context: Student instances
-grok.context(IStudent)
-
 class StudentPrincipalRoleManager(AnnotationPrincipalRoleManager,
                                     grok.Adapter):
     grok.provides(IPrincipalRoleManager)
+    grok.context(IStudent)
 
     #: The attribute name to lookup for additional roles
@@ -70,5 +68,5 @@
             obj = getattr(self._context, self.extra_attrib, None)
             current_level = 0
-        # Lookup local roles for connected course and all parent
+        # Lookup local roles for connected certificate and all parent
         # objects. This way we fake 'role inheritance'.
         while obj is not None:
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 9563)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 9565)
@@ -1406,4 +1406,60 @@
         self.assertTrue(self.student_id in self.browser.contents)
 
+    def test_handle_courses_by_lecturer(self):
+        # Create course lecturer
+        self.app['users'].addUser('mrslecturer', 'mrslecturersecret')
+        self.app['users']['mrslecturer'].email = 'mrslecturer@foo.ng'
+        self.app['users']['mrslecturer'].title = u'Mercedes Benz'
+        # Assign local Courselecturer100 role for a certificate
+        course = self.app['faculties']['fac1']['dep1'].courses['COURSE1']
+        prmlocal = IPrincipalRoleManager(course)
+        prmlocal.assignRoleToPrincipal('waeup.local.Lecturer', 'mrslecturer')
+        # Login as lecturer
+        self.browser.open(self.login_path)
+        self.browser.getControl(name="form.login").value = 'mrslecturer'
+        self.browser.getControl(name="form.password").value = 'mrslecturersecret'
+        self.browser.getControl("Login").click()
+        self.assertMatches('...You logged in...', self.browser.contents)
+        # CO can see her roles
+        self.browser.getLink("My Roles").click()
+        self.assertMatches(
+            '...<div>Academics Officer (view only)</div>...',
+            self.browser.contents)
+        # But not her local role ...
+        self.assertFalse('Lecturer' in self.browser.contents)
+        # ... because we forgot to notify the course that the local role
+        # has changed
+        notify(LocalRoleSetEvent(
+            course, 'waeup.local.Lecturer', 'mrslecturer', granted=True))
+        self.browser.open('http://localhost/app/users/mrslecturer/my_roles')
+        self.assertTrue('Lecturer' in self.browser.contents)
+        self.assertMatches(
+            '...<a href="http://localhost/app/faculties/fac1/dep1/courses/COURSE1">...',
+            self.browser.contents)
+        # The lecturer can go to her course
+        self.browser.getLink(
+            "http://localhost/app/faculties/fac1/dep1/courses/COURSE1").click()
+        # and view the list of students
+        self.browser.getLink("Show students").click()
+        self.assertTrue('<th>Fullname</th>' in self.browser.contents)
+        # No student in course so far
+        self.assertFalse(self.student_id in self.browser.contents)
+        studylevel = createObject(u'waeup.StudentStudyLevel')
+        studylevel.level = 100
+        self.student['studycourse'].addStudentStudyLevel(
+            self.certificate, studylevel)
+        # Now the student has registered the course and can
+        # be seen by the lecturer.
+        self.assertFalse(self.student_id in self.browser.contents)
+        # XXX: So far the lecturer can neither access ths student ...
+        self.assertRaises(
+            Unauthorized, self.browser.open, self.student_path)
+        # ... nor the respective course ticket since a
+        # CourseTicketPrincipalRoleManager does not yet exist.
+        self.assertTrue('COURSE1' in self.student['studycourse']['100'].keys())
+        course_ticket_path = self.student_path + '/studycourse/100/COURSE1'
+        self.assertRaises(
+            Unauthorized, self.browser.open, course_ticket_path)
+
     def test_change_current_mode(self):
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
