Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 7008)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 7009)
@@ -132,10 +132,20 @@
     title = u'Accommodation'
 
+    #@property
+    #def target(self):
+    #    prm = get_principal_role_manager()
+    #    principal = get_current_principal()
+    #    roles = [x[0] for x in prm.getRolesForPrincipal(principal.id)]
+    #    if 'waeup.Student' in roles:
+    #        return 'index'
+    #    else:
+    #        return 'manage'
+
 class BedTicketBreadcrumb(Breadcrumb):
     """A breadcrumb for bed tickets.
     """
     grok.context(IBedTicket)
-    @property
-
+
+    @property
     def title(self):
         return 'Bed Ticket %s' % self.context.getSessionString()
@@ -1012,5 +1022,5 @@
 # This manage form page is for both students and students officers.
 class AccommodationManageFormPage(WAeUPEditFormPage):
-    """ Page to manage the bed tickets
+    """ Page to manage bed tickets.
     """
     grok.context(IStudentAccommodation)
@@ -1021,9 +1031,5 @@
     title = 'Accommodation'
     pnav = 4
-
-    def unremovable(self):
-        prm = get_principal_role_manager()
-        roles = [x[0] for x in prm.getRolesForPrincipal(self.request.principal.id)]
-        return ('waeup.Student' in roles)
+    officers_only_actions = ['delBedTickets']
 
     def formatDatetime(self,datetimeobj):
@@ -1042,7 +1048,6 @@
         return
 
-    # We need an event handler which releases the bed space too.
-    @grok.action('Remove selected tickets')
-    def delBedTicket(self, **data):
+    @grok.action('Remove selected')
+    def delBedTickets(self, **data):
         form = self.request.form
         if form.has_key('val_id'):
@@ -1056,12 +1061,10 @@
         deleted = []
         for id in child_id:
-            # Students are not allowed to remove bed tickets
-            if not self.unremovable():
-                try:
-                    del self.context[id]
-                    deleted.append(id)
-                except:
-                    self.flash('Could not delete %s: %s: %s' % (
-                            id, sys.exc_info()[0], sys.exc_info()[1]))
+            try:
+                del self.context[id]
+                deleted.append(id)
+            except:
+                self.flash('Could not delete %s: %s: %s' % (
+                        id, sys.exc_info()[0], sys.exc_info()[1]))
         if len(deleted):
             self.flash('Successfully removed: %s' % ', '.join(deleted))
@@ -1070,7 +1073,20 @@
         return
 
-    @grok.action('Add bed ticket')
+    @grok.action('Book accommodation')
     def addBedTicket(self, **data):
         self.redirect(self.url(self.context, '@@add'))
+
+    def isStudent(self):
+        prm = get_principal_role_manager()
+        roles = [x[0] for x in prm.getRolesForPrincipal(self.request.principal.id)]
+        return 'waeup.Student' in roles
+
+    @property
+    def selected_actions(self):
+        sa = self.actions
+        if self.isStudent():
+            sa = [action for action in self.actions
+                  if not action in officers_only_actions]
+        return sa
 
 class BedTicketAddPage(WAeUPPage):
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 7008)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/accommodationmanagepage.pt	(revision 7009)
@@ -30,6 +30,5 @@
           <input type="checkbox"
     		 name="val_id"
-    		 tal:attributes="value cl/__name__"
-         tal:condition="not: view/unremovable" />
+    		 tal:attributes="value cl/__name__" />
         </td>
         <td> <a tal:attributes="href cl/__name__">
@@ -43,5 +42,5 @@
 
   <div class="actionButtons" tal:condition="view/availableActions">
-    <span tal:repeat="action view/actions"
+    <span tal:repeat="action view/selected_actions"
           tal:omit-tag="">
       <input tal:replace="structure action/render"/>
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 7008)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 7009)
@@ -497,4 +497,5 @@
         self.assertTrue('Processing of 1 rows failed' in self.browser.contents)
         self.assertTrue('Successfully processed 2 rows' in self.browser.contents)
+        return
 
     def test_student_change_password(self):
@@ -741,5 +742,5 @@
         self.assertMatches('...Clearance process has been started...',
                            self.browser.contents)
-
+        return
 
     def test_student_payments(self):
@@ -834,4 +835,5 @@
                            self.browser.contents)
         self.assertTrue(self.student.state,'school fee paid')
+        return
 
     def test_manage_accommodation(self):
@@ -856,9 +858,9 @@
         # Managers can use HOS code and book a bed space with it
         self.browser.open(self.acco_student_path)
-        self.browser.getControl("Add bed ticket").click()
+        self.browser.getControl("Book accommodation").click()
         self.assertMatches('...Wrong state...',
                            self.browser.contents)
         IWorkflowInfo(self.student).fireTransition('admit')
-        self.browser.getControl("Add bed ticket").click()
+        self.browser.getControl("Book accommodation").click()
         self.assertMatches('...Activation Code:...',
                            self.browser.contents)
@@ -872,5 +874,5 @@
         self.assertTrue(bed.owner,self.student_id)
         # BedTicketAddPage is now blocked
-        self.browser.getControl("Add bed ticket").click()
+        self.browser.getControl("Book accommodation").click()
         self.assertMatches('...Ticket for 2004 already created...',
             self.browser.contents)
@@ -889,8 +891,9 @@
         self.browser.getControl("Remove selected", index=0).click()
         self.assertMatches('...Successfully removed...', self.browser.contents)
-        # Due to an event handler also the bed has been released properly
+        # The bed has been released properly by the event handler
         bed = self.app['hostels']['hall-1']['hall-1_A_101_A']
         self.assertTrue(bed.owner == NOT_OCCUPIED)
+        return
 
     def test_student_accommodation(self):
-        pass
+        return
