changeset 801:d0510a89e701

Updated the authorization to fit the needs of the new status workflow.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 19 Nov 2015 16:53:30 +0100
parents 8c336f08e76f
children b04e55896104
files src/main/java/de/intevation/lada/util/auth/HeaderAuthorization.java
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;
     }
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)