Index: main/waeup.sirp/trunk/src/waeup/sirp/students/authentication.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/authentication.py	(revision 7234)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/authentication.py	(revision 7240)
@@ -60,4 +60,8 @@
 
     @property
+    def user_type(self):
+        return u'student'
+
+    @property
     def description(self):
         return self.title
@@ -126,5 +130,4 @@
             return None
         account = self.getAccount(credentials['login'])
-
         if account is None:
             return None
@@ -135,5 +138,6 @@
                              description=account.description,
                              email=account.email,
-                             phone=account.phone)
+                             phone=account.phone,
+                             user_type=account.user_type)
 
     def principalInfo(self, id):
@@ -266,4 +270,5 @@
     """
     grok.implements(IAuthPluginUtility)
+    grok.name('students_auth_setup')
 
     def register(self, pau):
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 7234)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 7240)
@@ -161,5 +161,5 @@
     grok.context(IStudentsContainer)
     grok.name('index')
-    grok.require('waeup.viewStudents')
+    grok.require('waeup.viewStudentsContainer')
     grok.template('containerpage')
     label = 'Student Section'
@@ -381,9 +381,10 @@
             email_from = self.config.email_admin
         username = self.request.principal.id
+        usertype = self.request.principal.user_type.title()
         body = data['body']
         #subject = u'Mail from SIRP'
         subject = data['subject']
         email_to = self.context.email
-        success = send_mail(fullname,username,self.config.name,
+        success = send_mail(fullname,username,usertype,self.config.name,
                   body,email_from,email_to,subject)
         if success:
@@ -1271,13 +1272,7 @@
         return
 
-    @property
-    def is_student(self):
-        prm = get_principal_role_manager()
-        roles = [x[0] for x in prm.getRolesForPrincipal(self.request.principal.id)]
-        return 'waeup.Student' in roles
-
     @grok.action('Remove selected')
     def delBedTickets(self, **data):
-        if self.is_student:
+        if getattr(self.request.principal, 'user_type', None) == 'student':
             self.flash('You are not allowed to remove bed tickets.')
             self.redirect(self.url(self.context))
@@ -1305,5 +1300,5 @@
     def selected_actions(self):
         sa = self.actions
-        if self.is_student:
+        if getattr(self.request.principal, 'user_type', None) == 'student':
             sa = [action for action in self.actions
                   if not action.label in self.officers_only_actions]
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/accommodationmanagepage.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/accommodationmanagepage.pt	(revision 7234)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/accommodationmanagepage.pt	(revision 7240)
@@ -18,5 +18,5 @@
     <thead>
     <tr>
-      <th tal:condition="not: view/is_student">&nbsp;</th>
+      <th tal:condition="not: layout/isStudent">&nbsp;</th>
       <th>Session</th>
       <th>Booking Date</th>
@@ -27,5 +27,5 @@
     <tbody>
       <tr tal:repeat="cl context/values">
-         <td tal:condition="not: view/is_student">
+         <td tal:condition="not: layout/isStudent">
           <input type="checkbox"
     		 name="val_id"
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py	(revision 7234)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py	(revision 7240)
@@ -123,5 +123,5 @@
 
     student_id = schema.TextLine(
-        title = u'Student ID',
+        title = u'Student Id',
         required = False,
         )
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/permissions.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/permissions.py	(revision 7234)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/permissions.py	(revision 7240)
@@ -29,6 +29,12 @@
     grok.name('waeup.viewStudent')
 
-class ViewStudents(grok.Permission):
-    grok.name('waeup.viewStudents')
+class ViewStudentsTab(grok.Permission):
+    grok.name('waeup.viewStudentsTab')
+
+class ViewMyStudentDataTab(grok.Permission):
+    grok.name('waeup.viewMyStudentDataTab')
+
+class ViewStudentsContainer(grok.Permission):
+    grok.name('waeup.viewStudentsContainer')
 
 class PayStudent(grok.Permission):
@@ -58,10 +64,11 @@
 class StudentRole(grok.Role):
     grok.name('waeup.Student')
-    grok.permissions('waeup.viewAcademics')
+    grok.permissions('waeup.viewAcademics', 'waeup.viewMyStudentDataTab')
 
 class StudentsOfficer(grok.Role):
     grok.name('waeup.StudentsOfficer')
     grok.title(u'Students Officer (view only)')
-    grok.permissions('waeup.viewStudent','waeup.viewStudents')
+    grok.permissions('waeup.viewStudent','waeup.viewStudents',
+          'waeup.viewStudentsTab', 'waeup.viewStudentsContainer')
 
 class StudentsManager(grok.Role):
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 7234)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 7240)
@@ -693,5 +693,5 @@
         self.browser.getControl(name="form.password").value = 'mrclearsecret'
         self.browser.getControl("Login").click()
-        self.assertTrue('You logged in' in self.browser.contents)
+        self.assertMatches('...You logged in...', self.browser.contents)
         # CO can see his roles
         self.browser.getLink("My Roles").click()
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py	(revision 7234)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py	(revision 7240)
@@ -163,5 +163,5 @@
     grok.context(IWAeUPObject)
     grok.order(4)
-    grok.require('waeup.viewStudents')
+    grok.require('waeup.viewStudentsTab')
     grok.template('primarynavtab')
 
@@ -200,29 +200,9 @@
         return ''
 
-#class HomeTab(PrimaryStudentNavTab):
-#    """Home-tab in primary navigation.
-#    """
-#    grok.order(1)
-#    grok.require('waeup.Authenticated')
-#    pnav = 0
-#    tab_title = u'Home'
-
-#class ProspectusTab(PrimaryStudentNavTab):
-#    """Faculties-tab in primary navigation.
-#    """
-#    grok.order(2)
-#    grok.require('waeup.viewAcademics')
-#    pnav = 1
-#    tab_title = u'Prospectus'
-
-#    @property
-#    def link_target(self):
-#        return self.view.application_url('faculties')
-
-class MyDataTab(PrimaryStudentNavTab):
+class MyStudentDataTab(PrimaryStudentNavTab):
     """MyData-tab in primary navigation.
     """
     grok.order(3)
-    grok.require('waeup.Authenticated')
+    grok.require('waeup.viewMyStudentDataTab')
     pnav = 4
     tab_title = u'My Data'
