Mercurial > lada > lada-server
changeset 964:3c1b1631e474
Explain with comments and remove conditions each applied by one above.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Mon, 30 May 2016 16:11:24 +0200 |
parents | 0e9c4718196f |
children | ad69878b7280 |
files | src/main/java/de/intevation/lada/util/auth/MessungAuthorizer.java |
diffstat | 1 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/util/auth/MessungAuthorizer.java Mon May 30 15:01:08 2016 +0200 +++ b/src/main/java/de/intevation/lada/util/auth/MessungAuthorizer.java Mon May 30 16:11:24 2016 +0200 @@ -109,6 +109,9 @@ messung.setReadonly(wert != 0 && wert != 4); boolean statusEdit = false; + + /* Does the user belong to an appropriate 'Leitstelle' to + edit status? */ if (userInfo.getFunktionen().contains(3)) { QueryBuilder<AuthLstUmw> lstFilter = new QueryBuilder<AuthLstUmw>( repository.entityManager("stamm"), @@ -124,22 +127,23 @@ } } } + + // Has the user the right to edit status for the 'Netzbetreiber'? if (userInfo.getFunktionenForNetzbetreiber( probe.getNetzbetreiberId()).contains(2) - && userInfo.getNetzbetreiber().contains( - probe.getNetzbetreiberId()) && (stufe == 1 || stufe == 2) && wert >= 1 ) { statusEdit = true; } + + // Has the user the right to edit status for the 'Messstelle'? if (userInfo.getFunktionenForMst(probe.getMstId()).contains(1) - && userInfo.belongsTo(probe.getMstId(), - probe.getLaborMstId()) && (stufe <= 1 || wert == 4) ) { statusEdit = true; } + messung.setStatusEdit(statusEdit); }