Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various levels lab user #130

Open
wants to merge 11 commits into
base: development
Choose a base branch
from
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 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
Loading