Index: /main/kofacustom.unidel/trunk/src/kofacustom/unidel/ftesting.zcml
===================================================================
--- /main/kofacustom.unidel/trunk/src/kofacustom/unidel/ftesting.zcml	(revision 17842)
+++ /main/kofacustom.unidel/trunk/src/kofacustom/unidel/ftesting.zcml	(revision 17843)
@@ -53,5 +53,7 @@
       principal="zope.Anybody"
       />
-
+  <grant
+      permission="waeup.Authenticated"
+      principal="zope.Authenticated" />
 
   <principal
Index: /main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/browser.py
===================================================================
--- /main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/browser.py	(revision 17842)
+++ /main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/browser.py	(revision 17843)
@@ -35,4 +35,5 @@
     StudentTriggerTransitionFormPage,
     ExportPDFAdmissionSlip,
+    ExportAttendanceSlip,
     PaymentsManageFormPage, msave, emit_lock_message)
 from waeup.kofa.students.interfaces import IStudentsUtils, ICourseTicket, IStudentBase
@@ -302,5 +303,48 @@
             note=self.note)
 
-class CustomExportPDFAdmissionSlip(ExportPDFAdmissionSlip):
-    grok.require('waeup.managePortal')
-
+
+class CustomExportAttendanceSlip(ExportAttendanceSlip):
+    """
+    """
+
+    #def _signatures(self):
+    #    return ([_('Student Signature')],
+    #            [_('Clearance Officer Signature')])
+
+    @property
+    def note(self):
+        return """
+
+        
+Faculty: __________________________________________________________
+
+Department: ______________________________________________________
+
+Date of Examination: _______________________________________________
+
+Time of Examination: _______________________________________________
+
+Venue of Examination: ______________________________________________
+
+Names of Supervisors:
+
+______________________________________________
+
+______________________________________________
+
+______________________________________________
+
+______________________________________________
+
+______________________________________________
+        """
+
+    def render(self):
+        lecturers = [i['user_title'] for i in self.getUsersWithLocalRoles()
+                     if i['local_role'] == 'waeup.local.Lecturer']
+        lecturers =  ', '.join(lecturers)
+        students_utils = getUtility(IStudentsUtils)
+        return students_utils.renderPDFCourseticketsOverview(
+            self, 'attendance', self.current_academic_session,
+            self.data(self.current_academic_session),
+            lecturers, '', 65, self.note)
Index: /main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/tests/test_browser.py
===================================================================
--- /main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/tests/test_browser.py	(revision 17842)
+++ /main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/tests/test_browser.py	(revision 17843)
@@ -34,6 +34,8 @@
 from waeup.kofa.interfaces import (
     IExtFileStore, IFileStoreNameChooser)
+from waeup.kofa.interfaces import IUserAccount, IJobManager, VALIDATED, CREATED
 from waeup.kofa.browser.tests.test_pdf import samples_dir
 from waeup.kofa.students.interfaces import IStudentsUtils
+from waeup.kofa.tests.test_authentication import SECRET
 from kofacustom.unidel.testing import FunctionalLayer
 
@@ -68,2 +70,54 @@
         open(path, 'wb').write(self.browser.contents)
         print "Sample exampclearance_slip.pdf written to %s" % path
+
+class LecturerUITests(StudentsFullSetup):
+
+    layer = FunctionalLayer
+
+    def login_as_lecturer(self):
+        self.app['users'].addUser('mrslecturer', SECRET)
+        self.app['users']['mrslecturer'].email = 'mrslecturer@foo.ng'
+        self.app['users']['mrslecturer'].title = u'Mercedes Benz'
+        # Add course ticket
+        self.studylevel = createObject(u'waeup.StudentStudyLevel')
+        self.studylevel.level = 100
+        self.studylevel.level_session = 2004
+        self.student['studycourse'].addStudentStudyLevel(
+            self.certificate, self.studylevel)
+        # Assign local Lecturer role for a course.
+        course = self.app['faculties']['fac1']['dep1'].courses['COURSE1']
+        prmlocal = IPrincipalRoleManager(course)
+        prmlocal.assignRoleToPrincipal('waeup.local.Lecturer', 'mrslecturer')
+        notify(LocalRoleSetEvent(
+            course, 'waeup.local.Lecturer', 'mrslecturer', granted=True))
+        # Login as lecturer.
+        self.browser.open(self.login_path)
+        self.browser.getControl(name="form.login").value = 'mrslecturer'
+        self.browser.getControl(
+            name="form.password").value = SECRET
+        self.browser.getControl("Login").click()
+        # Store reused urls/paths
+        self.course_url = (
+            'http://localhost/app/faculties/fac1/dep1/courses/COURSE1')
+        self.edit_scores_url = '%s/edit_scores' % self.course_url
+        # Set standard parameters
+        self.app['configuration'].current_academic_session = 2004
+        self.app['faculties']['fac1']['dep1'].score_editing_disabled = False
+        IWorkflowState(self.student).setState(VALIDATED)
+
+    def test_lecturers_can_download_attendance_sheet(self):
+        # A course ticket slip can be downloaded
+        self.course.title = (u'Lorem ipsum     dolor sit amet, consectetur     adipisici, '
+                             u'sed         eiusmod tempor    incidunt ut  labore et dolore')
+        self.student.firstname = u'Emmanuella Woyengifigha Mercy Onosemudiana'
+        self.student.lastname = u'OYAKEMIEGBEGHA'
+        self.student.matric_number = u'CMS/FBM/NSG/17/38186'
+        self.login_as_lecturer()
+        pdf_url = '%s/attendance.pdf' % self.course_url
+        self.browser.open(pdf_url)
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(
+            self.browser.headers['Content-Type'], 'application/pdf')
+        path = os.path.join(samples_dir(), 'attendance.pdf')
+        open(path, 'wb').write(self.browser.contents)
+        print "Sample PDF attendance.pdf written to %s" % path
