[Lada-commits] [PATCH] Permit users to add or reset a status on lower level

Wald Commits scm-commit at wald.intevation.org
Thu Feb 11 10:27:03 CET 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1455182832 -3600
# Node ID bf49eadf8dee0abbfbfdee1db6bcea1b195bea69
# Parent  ad64ef3379a832e07b94a67da3aaf7c324d5b896
Permit users to add or reset a status on lower level.

diff -r ad64ef3379a8 -r bf49eadf8dee src/main/java/de/intevation/lada/rest/StatusService.java
--- a/src/main/java/de/intevation/lada/rest/StatusService.java	Tue Feb 09 15:11:36 2016 +0100
+++ b/src/main/java/de/intevation/lada/rest/StatusService.java	Thu Feb 11 10:27:12 2016 +0100
@@ -255,8 +255,8 @@
                     i++
                 ) {
                     if (userInfo.getFunktionenForMst(
-                            status.getErzeuger()).get(i) >
-                                currentStatus.getStatusStufe() &&
+                            status.getErzeuger()).get(i) ==
+                                currentStatus.getStatusStufe() + 1 &&
                         currentStatus.getStatusWert() != 0
                     ) {
                         next = true;
diff -r ad64ef3379a8 -r bf49eadf8dee src/main/java/de/intevation/lada/util/auth/MessungAuthorizer.java
--- a/src/main/java/de/intevation/lada/util/auth/MessungAuthorizer.java	Tue Feb 09 15:11:36 2016 +0100
+++ b/src/main/java/de/intevation/lada/util/auth/MessungAuthorizer.java	Thu Feb 11 10:27:12 2016 +0100
@@ -107,14 +107,16 @@
             List<AuthLstUmw> lsts =
                 repository.filterPlain(lstFilter.getQuery(), "stamm");
             for (int i = 0; i < lsts.size(); i++) {
-                if (lsts.get(i).getUmwId().equals(probe.getUmwId())) {
+                if (lsts.get(i).getUmwId().equals(probe.getUmwId()) &&
+                    status.getStatusStufe() == 2 || status.getStatusStufe() == 3) {
                     statusEdit = true;
                 }
             }
         }
         else if (userInfo.getFunktionen().contains(2) &&
             userInfo.getNetzbetreiber().contains(probe.getNetzbetreiberId()) &&
-            status.getStatusStufe() <= 2) {
+            (status.getStatusStufe() == 1 || status.getStatusStufe() == 2) &&
+            status.getStatusWert() >= 1) {
             statusEdit = true;
         }
         else if (userInfo.getFunktionen().contains(1) &&


More information about the Lada-commits mailing list