Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/root.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/root.py	(revision 13232)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/root.py	(revision 13233)
@@ -97,4 +97,6 @@
             #    logger.info(
             #        '%s: description_dict added to root.' % self.log_prefix)
+
+            # Add container_code index
             try:
                 cat = getUtility(ICatalog, name='applicants_catalog')
@@ -109,4 +111,5 @@
                 pass
 
+            # Remove old applicant ids from global role map.
             try:
                 removed_applicant_ids = []
@@ -128,4 +131,27 @@
                         '%s: %s removed from global role map.'
                         % (self.log_prefix, removed_applicant_ids))
+            except ComponentLookupError: # in unit tests
+                pass
+
+            # Remove old student ids from global role map.
+            try:
+                removed_student_ids = []
+                cat = getUtility(ICatalog, name='students_catalog')
+                role_manager = IPrincipalRoleManager(grok.getSite())
+                principals = role_manager.getPrincipalsForRole('waeup.Student')
+                for principal in principals:
+                    student_id = principal[0]
+                    results = cat.searchResults(student_id=(student_id, student_id))
+                    if len(results):
+                        continue
+                    # The student does no longer exist.
+                    nothing_to_do = False
+                    role_manager.unsetRoleForPrincipal(
+                        'waeup.Student', student_id)
+                    removed_student_ids.append(student_id)
+                if len(removed_student_ids):
+                    logger.info(
+                        '%s: %s removed from global role map.'
+                        % (self.log_prefix, removed_student_ids))
             except ComponentLookupError: # in unit tests
                 pass
