Skip to content

Commit

Permalink
set testresultverified to false if user is a labuser
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony4m committed Aug 15, 2022
1 parent ce4d0ad commit 3abac50
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
/*
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
* Copyright © 2016-2018 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
*

This comment has been minimized.

Copy link
@faatihi

faatihi May 12, 2023

Member

The empty lines are removed. Why is that

This comment has been minimized.

Copy link
@Anthony4m

Anthony4m May 12, 2023

Author Collaborator

IDE taking out lines with no content

* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Expand All @@ -31,6 +28,7 @@
import de.symeda.sormas.api.sormastosormas.SormasToSormasConfig;
import de.symeda.sormas.api.user.UserDto;
import de.symeda.sormas.api.user.UserReferenceDto;
import de.symeda.sormas.api.user.UserRole;
import de.symeda.sormas.api.utils.DataHelper;
import de.symeda.sormas.api.utils.DateFormatHelper;
import de.symeda.sormas.api.utils.FieldConstraints;
Expand Down Expand Up @@ -133,6 +131,9 @@ public static PathogenTestDto build(SampleDto sample, UserDto currentUser) {
if (sample.getSamplePurpose() == SamplePurpose.INTERNAL) {
pathogenTest.setTestResultVerified(true);
}
if (currentUser.getUserRoles().contains(UserRole.LAB_USER)) {
pathogenTest.setTestResultVerified(false);
}
pathogenTest.setLab(currentUser.getLaboratory());
if (pathogenTest.getLab() == null) {
pathogenTest.setLab(sample.getLab());
Expand Down

0 comments on commit 3abac50

Please sign in to comment.