changeset 874:bf49eadf8dee

Permit users to add or reset a status on lower level.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 11 Feb 2016 10:27:12 +0100
parents ad64ef3379a8
children 9c5a5afb6708
files src/main/java/de/intevation/lada/rest/StatusService.java src/main/java/de/intevation/lada/util/auth/MessungAuthorizer.java
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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) &&
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)