1
的下面下面是我想如何配置安全配置文件爲我的Play應用程序–在auth.securityProfiles
每個條目由一個Operation => Roles
雙整體配置部分:遊戲框架:如何閱讀由未知鍵
auth {
securityProfiles {
myOperation1 = "author, auditor"
myOperation2 = "admin"
myOperationN = "auditor, default"
}
}
如何閱讀第auth.securityProfiles
部分中的所有條目以生成此類Map
?
val securityProfiles = Map(
"myOperation1" -> "author, auditor",
"myOperation2" -> "admin",
"myOperationN" -> "auditor, default"
)
謝謝。
您是否嘗試過[this](https://github.com/playframework/playframework/blob/master/framework/src/play/src/main/scala/play/api/Configuration.scala?source=cc #L258),然後將配置轉換爲映射? –