comparison src/main/java/de/intevation/lada/rest/ProbeService.java @ 1332:65ed13ff9945 2.6.1

Changed authorization for Messprogramm. * Added 'readonly' flag * Only user with function '4' and the corresponding 'netzbetreiber' are allowed to edit. * User authorized to create a 'probe' are allowed to generate proben.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 29 Mar 2017 14:25:56 +0200
parents 14876c62f692
children
comparison
equal deleted inserted replaced
1331:03faaba3c2a3 1332:65ed13ff9945
354 Messprogramm messprogramm = repository.getByIdPlain( 354 Messprogramm messprogramm = repository.getByIdPlain(
355 Messprogramm.class, id, "land"); 355 Messprogramm.class, id, "land");
356 if (messprogramm == null) { 356 if (messprogramm == null) {
357 return new Response(false, 600, null); 357 return new Response(false, 600, null);
358 } 358 }
359 359 // Use a dummy probe with same mstId as the messprogramm to authorize
360 /* Allow generation of Probe objects only for a Messprogramm 360 // the user to create probe objects.
361 * that would be allowed to be changed. */ 361 Probe testProbe = new Probe();
362 testProbe.setMstId(messprogramm.getMstId());
362 if (!authorization.isAuthorized( 363 if (!authorization.isAuthorized(
363 request, 364 request,
364 messprogramm, 365 testProbe,
365 RequestMethod.PUT, 366 RequestMethod.POST,
366 Messprogramm.class) 367 Probe.class)
367 ) { 368 ) {
368 return new Response(false, 699, null); 369 return new Response(false, 699, null);
369 } 370 }
370 371
371 long start = 0; 372 long start = 0;
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)