Skip to content

Commit

Permalink
add assertion that directoryName and organizationId must be defined t…
Browse files Browse the repository at this point in the history
…ogether
  • Loading branch information
Michael Büßemeyer authored and Michael Büßemeyer committed Dec 3, 2024
1 parent 6b6d8e9 commit e6db2c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/AuthenticationController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ 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."
isSuperUser <- multiUserDAO.findOne(request.identity._multiUser).map(_.isSuperUser)
selectedOrganization <- if (isSuperUser)
accessibleBySwitchingForSuperUser(datasetIdValidated,
Expand Down

0 comments on commit e6db2c3

Please sign in to comment.