[Lada-commits] [PATCH 2 of 4] Updated the authorization to fit the needs of the new status workflow

Wald Commits scm-commit at wald.intevation.org
Thu Nov 19 16:55:33 CET 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1447948410 -3600
# Node ID d0510a89e70111015465f903d71ec2a0660b0ac3
# Parent  8c336f08e76fbd8385efe1115493acdcc4d5cc9c
Updated the authorization to fit the needs of the new status workflow.

diff -r 8c336f08e76f -r d0510a89e701 src/main/java/de/intevation/lada/util/auth/HeaderAuthorization.java
--- a/src/main/java/de/intevation/lada/util/auth/HeaderAuthorization.java	Thu Nov 19 16:52:30 2015 +0100
+++ b/src/main/java/de/intevation/lada/util/auth/HeaderAuthorization.java	Thu Nov 19 16:53:30 2015 +0100
@@ -212,7 +212,14 @@
                             messung.getProbeId(),
                             "land");
                     LProbe probe = (LProbe)pResponse.getData();
-                    return !this.isMessungReadOnly(messung) &&
+                    if (messung.getStatus() == null) {
+                        return false;
+                    }
+                    LStatusProtokoll status = repository.getByIdPlain(
+                        LStatusProtokoll.class,
+                        messung.getStatus(),
+                        "land");
+                    return status.getStatusWert() == 0 &&
                         getAuthorization(userInfo, probe);
                 }
             }
@@ -617,6 +624,10 @@
         if (data instanceof LProbe) {
             return getAuthorization(userInfo, (LProbe)data);
         }
+        else if (data instanceof LMessung) {
+            LProbe probe = repository.getByIdPlain(LProbe.class, ((LMessung)data).getProbeId(), "land");
+            return getAuthorization(userInfo, probe);
+        }
         return false;
     }
 


More information about the Lada-commits mailing list