public boolean support(Entity entity) {
    if ((entity instanceof Report) && ((Report) entity).getType().equals(ReportConstants.NEXT)) {
      try {
        if (securityService.hasPermissionsById(
            ServerUtil.getUsername(), PermissionUtil.getWrite(), entity.getId())) {
          DataSource ds = ((Report) entity).getDataSource();
          if (securityService.hasPermissionsById(
              ServerUtil.getUsername(), PermissionUtil.getRead(), ds.getId())) {
            return true;
          }
        }
      } catch (Exception e) {
        e.printStackTrace();
      }
    }

    return false;
  }
 public String getUserRealm() {
   return ServerUtil.getRealm(getUsername());
 }