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
- Can Slick Delete/Update DB Query return Negative Integer Values as the result
- Scala: How to count occurrences of unique items in a certain index?
- How do I make packages available to the Scala REPL?
- How to use java.String.format in Scala?
- MongoDB countDocuments() very slow in Scala as compared to MongoDB Compass
- What is the precedence of type operators (bounds) in scala?
- What happens if an RDD can't fit into memory in Spark?
- Turn TCP socket to Observable of Array[Byte]
- Scala functional programming operator :::
- How to read from textfile(String type data) map and load data into parquet format(multiple columns with different datatype) in Spark scala dynamically
- Java controllers in Scala project in play framework?
- How to depend on the sources of another project
- Why SPARK repeat transformations after persist operations?
- Unexpected result when invoke functions within method in scala
- Debug, Warn & Info messages from non-main class not visible in spark executor logging
- How to generate a DataFrame with some content and N rows?
- Spark (v2) does not generate output if the size is more than 2 GB
- Passing scala `Comparable` array to java generic method
- Mixing Parallel Collections with Akka
- Force inheriting class to implement methods as protected
- Pattern matching a list with conditionals
- HiveContext.sql("insert into")
- Scala, advise on method signature
- Consistently handling network partitions and split-brain scenarios in Akka
- Scala traits stacking
- Shapeless align with different types but same labels
- Finding mutual friends for a huge dataset
- Facing Ambiguous Reference to SQL Error in Spark Scala
- Scala Type mismatch, expected: List[NotInferedA], actual: List[Int]
- Do partitions increase performance when only using one computer/node?