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

Non-public datasets accessed using a token do honor default settings #3261

Merged
merged 3 commits into from
Sep 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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