[Lada-commits] [PATCH] Check if current status stufe is lower or equal to the users funktion

Wald Commits scm-commit at wald.intevation.org
Thu Feb 4 13:50:15 CET 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1454590224 -3600
# Node ID 04bec189ca196082e7b1a0d03311b0c7d4ab3f95
# Parent  68348c675b132b90011ebc7a059b79fac2018341
Check if current status stufe is lower or equal to the users funktion.

diff -r 68348c675b13 -r 04bec189ca19 src/main/java/de/intevation/lada/util/auth/MessungAuthorizer.java
--- a/src/main/java/de/intevation/lada/util/auth/MessungAuthorizer.java	Thu Feb 04 09:40:20 2016 +0100
+++ b/src/main/java/de/intevation/lada/util/auth/MessungAuthorizer.java	Thu Feb 04 13:50:24 2016 +0100
@@ -86,14 +86,14 @@
         else {
             messung.setOwner(false);
         }
+        LStatusProtokoll status = repository.getByIdPlain(
+            LStatusProtokoll.class,
+            messung.getStatus(),
+            "land");
         if (messung.getStatus() == null) {
             messung.setReadonly(false);
         }
         else {
-            LStatusProtokoll status = repository.getByIdPlain(
-                LStatusProtokoll.class,
-                messung.getStatus(),
-                "land");
             messung.setReadonly(
                 status.getStatusWert() != 0 && status.getStatusWert() != 4);
         }
@@ -113,11 +113,14 @@
             }
         }
         else if (userInfo.getFunktionen().contains(2) &&
-            userInfo.getNetzbetreiber().contains(probe.getNetzbetreiberId())) {
+            userInfo.getNetzbetreiber().contains(probe.getNetzbetreiberId()) &&
+            status.getStatusStufe() <= 2) {
             statusEdit = true;
         }
         else if (userInfo.getFunktionen().contains(1) &&
-            userInfo.getMessstellen().contains(probe.getMstId())) {
+            userInfo.getMessstellen().contains(probe.getMstId()) &&
+            status.getStatusStufe() <= 1
+        ) {
             statusEdit = true;
         }
         messung.setStatusEdit(statusEdit);


More information about the Lada-commits mailing list