[Lada-commits] [PATCH 2 of 2] Removed filtering of messstellen

Wald Commits scm-commit at wald.intevation.org
Wed May 20 10:14:33 CEST 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1432109664 -7200
# Node ID db1c69416eb676160bb8749013d3adbcbbdde1bf
# Parent  d92abc9bcd414bfd925495699ea78feb22e43ee2
Removed filtering of messstellen.

diff -r d92abc9bcd41 -r db1c69416eb6 src/main/java/de/intevation/lada/rest/stamm/MessstelleService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/MessstelleService.java	Wed May 20 10:13:58 2015 +0200
+++ b/src/main/java/de/intevation/lada/rest/stamm/MessstelleService.java	Wed May 20 10:14:24 2015 +0200
@@ -7,8 +7,6 @@
  */
 package de.intevation.lada.rest.stamm;
 
-import java.util.ArrayList;
-
 import javax.enterprise.context.RequestScoped;
 import javax.inject.Inject;
 import javax.servlet.http.HttpServletRequest;
@@ -26,8 +24,6 @@
 import de.intevation.lada.util.annotation.RepositoryConfig;
 import de.intevation.lada.util.auth.Authorization;
 import de.intevation.lada.util.auth.AuthorizationType;
-import de.intevation.lada.util.auth.UserInfo;
-import de.intevation.lada.util.data.QueryBuilder;
 import de.intevation.lada.util.data.Repository;
 import de.intevation.lada.util.data.RepositoryType;
 import de.intevation.lada.util.rest.Response;
@@ -93,12 +89,7 @@
         @Context HttpServletRequest request,
         @Context UriInfo info
     ) {
-        UserInfo userInfo = authorization.getInfo(request);
-        QueryBuilder<MessStelle> builder =
-            new QueryBuilder<MessStelle>(
-                defaultRepo.entityManager("stamm"), MessStelle.class);
-        builder.or("id", userInfo.getMessstellen());
-        return defaultRepo.filter(builder.getQuery(), "stamm");
+        return defaultRepo.getAll(MessStelle.class, "stamm");
     }
 
     /**
@@ -118,10 +109,6 @@
         @Context HttpServletRequest request,
         @PathParam("id") String id
     ) {
-        UserInfo userInfo = authorization.getInfo(request);
-        if (userInfo.getMessstellen().contains(id)) {
-            return defaultRepo.getById(MessStelle.class, id, "stamm");
-        }
-        return new Response(false, 698, new ArrayList<MessStelle>());
+        return defaultRepo.getById(MessStelle.class, id, "stamm");
     }
 }


More information about the Lada-commits mailing list