Example #1
0
  @SuppressWarnings("deprecation")
  private void intAuthorizedUserGUI() {
    final ClientFactory clientFactory = GWT.create(ClientFactory.class);
    SiteHeader header = clientFactory.getHeader();
    // user.setAdmin(true);
    if (user.getAdmin()) {
      header.setVisibleAdminButtons();
      header.setVisibleOperatorButtons();
    } else {
      header.setVisibleOperatorButtons(user.getRoles());
    }
    header.setVisibleFooterAndHeader();
    RootPanel rootLayoutPanel = RootPanel.get("container");
    rootLayoutPanel.add(contentPanel);
    contentPanel.setStyleName("content-container");

    ActivityMapper activityMapper = new CustomActivityMapper(clientFactory);
    ActivityManager activityManager =
        new ActivityManager(activityMapper, clientFactory.getEventBus());
    activityManager.setDisplay(contentPanel);

    PlaceHistoryHandler historyHandler =
        new PlaceHistoryHandler((PlaceHistoryMapper) GWT.create(CustomPlaceHistoryMapper.class));
    historyHandlerRegistration =
        historyHandler.register(
            clientFactory.getPlaceController(), clientFactory.getEventBus(), new AboutPagePlace());
    historyHandler.handleCurrentHistory();
    setWaitingBlockVisible(false);
  }
Example #2
0
 public static boolean hasUserRole(String roledirectoryident) {
   if (user.getAdmin()) {
     return true;
   }
   for (RoleDto dto : user.getRoles()) {
     if (dto.getIdent().equals(roledirectoryident)) {
       return true;
     }
   }
   return false;
 }