From 57f5135ef8840b8d90f70718e2ffa9c8e98e6e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20B=C3=BC=C3=9Femeyer?= Date: Thu, 5 Dec 2024 16:19:29 +0100 Subject: [PATCH] simplify assertion in backend --- app/controllers/AuthenticationController.scala | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/controllers/AuthenticationController.scala b/app/controllers/AuthenticationController.scala index 613dd1c4bb..6dcfead2cb 100755 --- a/app/controllers/AuthenticationController.scala +++ b/app/controllers/AuthenticationController.scala @@ -241,10 +241,7 @@ class AuthenticationController @Inject()( implicit request => for { datasetIdValidated <- Fox.runOptional(datasetId)(ObjectId.fromString(_)) - _ <- Fox - .runIf(datasetDirectoryName.isDefined)(bool2Fox(organizationId.isDefined)) ?~> "Organization id must be defined if dataset directory name is defined." - _ <- Fox - .runIf(organizationId.isDefined)(bool2Fox(datasetDirectoryName.isDefined)) ?~> "Directory name must be defined if dataset organization id is defined." + _ <- bool2Fox(datasetDirectoryName.isDefined == organizationId.isDefined) ?~> "Organization id and directory name must be defined together." isSuperUser <- multiUserDAO.findOne(request.identity._multiUser).map(_.isSuperUser) selectedOrganization <- if (isSuperUser) accessibleBySwitchingForSuperUser(datasetIdValidated,