I'm trying to disable a tab in a TabbedPanel based on authorization. I'm using wicket-auth-roles, and it works in other places, for example for buttons. Could anybody tell me what I'm doing wrong? The tab just keeps on showing, and if you click on it you go to a page that states that you don't have authorization for that page. (As I have added an annotation to that page as well.)

public class BookDetailsPanel extends Panel {
   ...
public BookDetailsPanel(String id, final String isbn, boolean showEditPanel) {
      ...
      List tabs = new ArrayList();
      ...
      tabs.add(new OwnerEditTab(new Model("edit"), isbn));
      ...
   }
   @AuthorizeAction(action = Action.RENDER, roles = { "OWNER" })
   private class OwnerEditTab extends AbstractTab {
       private static final long serialVersionUID = 1L;
       private String isbn;
public OwnerEditTab(IModel model, String isbn) {
           super(model);
           this.isbn = isbn;
       }
@Override
       public Panel getPanel(String panelId) {
           return new BookDetailsEditPanel(panelId, isbn);
       }
   }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to