score:0
Accepted answer
here is my solution... i've just modified the configuration like this...
auth {
securityprofiles = [
{
operation = "myoperation1"
roles = ["author", "auditor"]
}
{
operation = "myoperation2"
roles = ["admin"]
}
{
operation = "myoperationn"
roles = ["auditor", "default"]
}
]
}
... and then read it with the following code snipper:
import scala.collection.mutable.map
var securityprofiles = map[string, list[string]]().withdefaultvalue(list.empty)
configuration.getconfiglist("auth.securityprofiles").map { _.tolist.map { config =>
config.getstring("operation").map { op =>
securityprofiles += (op -> config.getstringlist("roles").map(_.tolist).getorelse(list.empty))
}
}}
i hope that helps.
Source: stackoverflow.com
Related Query
- Play Framework: How to read an entire configuration section consisting of unknown keys
- Play framework JSON reads: How to read either String or Int?
- How to read a file in Play Framework 2.2.1?
- Play Framework 2.4.1: How to get configuration values just after configuration file has been loaded
- How to read properties file in Play framework 2.5
- How to read and write Anorm object with the new JSON API in Play Framework 2.1-RC2?
- How to read a string as a long passed in JSON using Play framework
- How to read json array in scala using the Play framework
- How to read system variable into a conf file in Play framework
- how to ignore Play Framework WS SSL certs without making my entire application insecure?
- How to read size in bytes syntax in Play configuration (HOCON)?
- How do you read the HTML content of an Atom feed with Scala and Play framework 2.0?
- How to handle optional query parameters in Play framework
- How to use IntelliJ with Play Framework and Scala
- How to integrate Play Framework 2.0 into Gradle build management using Maven dependencies?
- How to implement implicit Json Writes of embedded object in Play Framework 2.x
- How to contribute modules in Play Framework 2.0?
- How do I find the absolute path to a Play Framework app?
- How to render JSON response in Play framework v2.0 (latest build from GIT)
- Play framework how do sessions and cookies work?
- How to force Play framework 2 to always use SSL?
- How to improve the error message readability returned from JsError.toFlatJson or JsError.toJson in Play framework 2.x?
- How do you change the Play 2.1! Framework session cookie name
- How exactly does Play framework 2.0 controllers / Async work?
- Play Framework 2.1: Scala: how to get the whole base url (including protocol)?
- How to test a Scala Play Framework websocket?
- How to schedule an hourly job with Play Framework 2.1?
- How to create a global variable with Play Framework 2.0
- How to convert Play Framework Models into XML and JSON?
- How do I get Intellij IDEA 12.0 to work with Play Framework 2.1.0 app and Scala 2.10.0?
More Query from same tag
- How to use Spark-Scala to download a CSV file from the web?
- json4s extract error in scala with map values
- About Scala's assignments and setter methods
- Scala constructors using val not playing nicely with serialization framework
- Immutable Scala Collection
- How to use a Java method in Scala
- Can not download jars when building scala project with sbteclipse?
- Replace every word in a document based on a defined pattern
- Specifying a frame icon on Scala’s Swing Frame
- How to get a subset of a map?
- Scala, cats - how to create tagless-final implementation with IO (or other monad) and Either?
- How does ScalaTest analyzes assert expressions?
- Is there a better way to go about this process of trimming my spark DataFrame appropriately?
- Convert JSON from a URL to dataframe (Pyspark and Scala)
- Can't get semantics of this loop in macro expanding
- Play with Activator Issue on IntelliJ Idea 14
- Akka/Scala: Can You Explain What's Going On in this Akka Streams Flow?
- ScalaTest own matcher, use of word not
- What is the difference between "def" and "val" to define a function
- Eliminating null usage in a Scala stack implementation
- Scala, Either[_, Seq[Either[_, T]] to Either[_, Seq[T]]
- How can I group in Scala
- Tell intelliJ to compile module with scalac in a java project?
- How to properly use JSExport methods in a JSExportTopLevel object in Scala.js from a <script> tag?
- Scala: copy case class from common supertype
- Why is 0.29999999999999998 converted to 0.3?
- Difference between Actorref.tell and inbox.send in Akka
- datastructure that holds closures, parametrically in scala
- Filter a list based on two parameters
- No applicable constructor/method found when accessing each row in a Dataset in Spark