Index: main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py	(revision 7242)
+++ main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py	(revision 7243)
@@ -234,5 +234,4 @@
     grok.order(3)
     grok.require('waeup.viewApplicationsTab')
-    grok.template('primarynavtab')
     pnav = 3
     tab_title = u'Applicants'
@@ -252,12 +251,10 @@
 
     # Also zope.manager has role Anonymous.
-    # To avoid displaying this tab, uncomment the following.
-    #def tab_title(self):
-    #    userid = self.request.principal.id
-    #    if userid != 'zope.anybody':
-    #        tt = u''
-    #    else:
-    #        tt = u'Application'
-    #    return tt
+    # To avoid displaying this tab, we have to check the principal id too.
+    @property
+    def link_target(self):
+        if self.request.principal.id == 'zope.anybody':
+            return self.view.application_url('applicants')
+        return
 
 class MyApplicationDataTab(PrimaryStudentNavTab):
@@ -266,5 +263,4 @@
     grok.order(3)
     grok.require('waeup.viewMyApplicationDataTab')
-    grok.template('primarynavtab')
     pnav = 3
     tab_title = u'My Data'
Index: main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/primarynavtab.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/primarynavtab.pt	(revision 7242)
+++ 	(revision )
@@ -1,7 +1,0 @@
-<li tal:attributes="class viewlet/active">
-  <a href="#"
-     tal:attributes="href viewlet/link_target"
-     tal:content="viewlet/tab_title">
-    Primary Tab Title
-  </a>
-</li>
Index: main/waeup.sirp/trunk/src/waeup/sirp/browser/layout.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/browser/layout.py	(revision 7242)
+++ main/waeup.sirp/trunk/src/waeup/sirp/browser/layout.py	(revision 7243)
@@ -44,4 +44,8 @@
 default_waeup_edit_template.__grok_name__ = 'default_waeup_edit_form'
 
+default_primary_nav_template = grokcore.view.PageTemplateFile(
+    os.path.join('templates', 'primarynavtab.pt'))
+default_primary_nav_template.__grok_name__ = 'default_primary_nav'
+
 
 def NullValidator(*args, **kw):
Index: main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/primarynavtab.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/primarynavtab.pt	(revision 7242)
+++ main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/primarynavtab.pt	(revision 7243)
@@ -1,3 +1,3 @@
-<li tal:attributes="class viewlet/active">
+<li tal:attributes="class viewlet/active" tal:condition="viewlet/link_target">
   <a href="#"
      tal:attributes="href viewlet/link_target"
Index: main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py	(revision 7242)
+++ main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py	(revision 7243)
@@ -30,5 +30,5 @@
 from waeup.sirp.interfaces import (IWAeUPObject, IWAeUPXMLExporter,
                                    IWAeUPXMLImporter, IDataCenter, IUserAccount)
-from waeup.sirp.browser.layout import WAeUPPage
+from waeup.sirp.browser.layout import WAeUPPage, default_primary_nav_template
 from waeup.sirp.utils.helpers import get_user_account
 
@@ -571,4 +571,5 @@
     grok.order(1)
     grok.require('waeup.Public')
+    template = default_primary_nav_template
 
     pnav = 0 # This is a kind of id of a tab. If some page provides
@@ -600,5 +601,4 @@
     grok.order(1)
     grok.require('waeup.Public')
-    grok.template('primarynavtab')
 
     pnav = 0
@@ -610,5 +610,4 @@
     grok.order(2)
     grok.require('waeup.viewAcademics')
-    grok.template('primarynavtab')
 
     pnav = 1
@@ -628,11 +627,14 @@
     grok.order(6)
     grok.require('waeup.Anonymous')
-    grok.template('primarynavtab')
     tab_title = u'Enquiries'
     pnav = 2
 
+    # Also zope.manager has role Anonymous.
+    # To avoid displaying this tab, we have to check the principal id too.
     @property
     def link_target(self):
-        return self.view.application_url('enquiries')
+        if self.request.principal.id == 'zope.anybody':
+            return self.view.application_url('enquiries')
+        return
 
 #
Index: main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser.py	(revision 7242)
+++ main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser.py	(revision 7243)
@@ -28,4 +28,6 @@
 from waeup.sirp.browser.breadcrumbs import Breadcrumb
 from waeup.sirp.browser.resources import datepicker, datatable, tabs, toggleall
+from waeup.sirp.browser.layout import default_primary_nav_template
+from waeup.sirp.browser.pages import delSubobjects
 from waeup.sirp.browser.viewlets import (
     ManageActionButton, PrimaryNavTab, AddActionButton)
@@ -34,5 +36,4 @@
     FriendlyDateWidget, FriendlyDateDisplayWidget,
     FriendlyDatetimeDisplayWidget)
-from waeup.sirp.browser.pages import delSubobjects
 from waeup.sirp.authentication import get_principal_role_manager
 from waeup.sirp.hostels.container import HostelsContainer
@@ -68,6 +69,5 @@
     grok.order(5)
     grok.require('waeup.viewHostels')
-    grok.template('primarynavtab')
-
+    template = default_primary_nav_template
     pnav = 5
     tab_title = u'Hostels'
Index: main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser_templates/primarynavtab.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser_templates/primarynavtab.pt	(revision 7242)
+++ 	(revision )
@@ -1,7 +1,0 @@
-<li tal:attributes="class viewlet/active">
-  <a href="#"
-     tal:attributes="href viewlet/link_target"
-     tal:content="viewlet/tab_title">
-    Primary Tab Title
-  </a>
-</li>
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/primarynavtab.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/primarynavtab.pt	(revision 7242)
+++ 	(revision )
@@ -1,7 +1,0 @@
-<li tal:attributes="class viewlet/active">
-  <a href="#"
-     tal:attributes="href viewlet/link_target"
-     tal:content="viewlet/tab_title">
-    Primary Tab Title
-  </a>
-</li>
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py	(revision 7242)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py	(revision 7243)
@@ -25,4 +25,5 @@
 from waeup.sirp.browser import DEFAULT_IMAGE_PATH
 from waeup.sirp.browser.viewlets import PrimaryNavTab
+from waeup.sirp.browser.layout import default_primary_nav_template
 from waeup.sirp.students.browser import (
     StudentClearanceDisplayFormPage, StudentClearanceManageFormPage,
@@ -164,5 +165,4 @@
     grok.order(4)
     grok.require('waeup.viewStudentsTab')
-    grok.template('primarynavtab')
 
     pnav = 4
@@ -183,5 +183,5 @@
     grok.baseclass()
     grok.viewletmanager(PrimaryStudentNavManager)
-    grok.template('primarynavtab')
+    template = default_primary_nav_template
     grok.order(1)
     grok.require('waeup.Authenticated')
