Skip to content

Commit

Permalink
Merge pull request #3261 from scalableminds/default-setting-for-non-p…
Browse files Browse the repository at this point in the history
…ublic-datasets

Non-public datasets accessed using a token do honor default settings
  • Loading branch information
rschwanhold authored Sep 24, 2018
2 parents 5496c34 + deeaf3d commit 7dd7d91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/ConfigurationController.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package controllers

import com.scalableminds.util.accesscontext.DBAccessContext
import com.scalableminds.util.accesscontext.{DBAccessContext, GlobalAccessContext}
import com.scalableminds.util.tools.Fox
import javax.inject.Inject
import models.binary.{DataSet, DataSetDAO}
Expand Down Expand Up @@ -50,7 +50,7 @@ class ConfigurationController @Inject()(userService: UserService,
configurationJson: JsValue <- userDataSetConfigurationDAO.findOneForUserAndDataset(user._id, dataSetName)
} yield DataSetConfiguration(configurationJson.validate[Map[String, JsValue]].getOrElse(Map.empty))
}
.orElse(dataSetDAO.findOneByName(dataSetName).flatMap(_.defaultConfiguration))
.orElse(dataSetDAO.findOneByName(dataSetName)(GlobalAccessContext).flatMap(_.defaultConfiguration))
.getOrElse(dataSetConfigurationDefaults.constructInitialDefault(List()))
.map(configuration => Ok(toJson(dataSetConfigurationDefaults.configurationOrDefaults(configuration))))
}
Expand Down

0 comments on commit 7dd7d91

Please sign in to comment.