mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 17:56:46 +00:00
Revert "feature/Tweak function addScopesToConsumer to accept and Berlin Group roles"
This reverts commit 39ba747716.
This commit is contained in:
parent
38ed185012
commit
ac446bccd0
@ -528,8 +528,7 @@ object OAuth2Login extends RestHelper with MdcLoggable {
|
||||
val openBankRoles: List[String] =
|
||||
// Sync Keycloak's roles
|
||||
(json \ "resource_access" \ resourceAccessName \ "roles").extract[List[String]]
|
||||
// Keep only the roles OBP-API can recognise
|
||||
.filter(role => tryo(ApiRole.valueOf(role)).isDefined || ApiRole.isBerlinGroupRole(role))
|
||||
.filter(role => tryo(ApiRole.valueOf(role)).isDefined) // Keep only the roles OBP-API can recognise
|
||||
val scopes = Scope.scope.vend.getScopesByConsumerId(consumerPrimaryKey.toString).getOrElse(Nil)
|
||||
val databaseState = scopes.map(_.roleName)
|
||||
// Already exist at DB
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package code.api.util
|
||||
|
||||
import code.api.Constant.{SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID, SYSTEM_READ_ACCOUNTS_BERLIN_GROUP_VIEW_ID, SYSTEM_READ_BALANCES_BERLIN_GROUP_VIEW_ID, SYSTEM_READ_TRANSACTIONS_BERLIN_GROUP_VIEW_ID}
|
||||
import code.api.dynamic.endpoint.helper.DynamicEndpointHelper
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
@ -1059,16 +1058,6 @@ object ApiRole extends MdcLoggable{
|
||||
dynamicRoles ::: roles.map(_.toString)
|
||||
}
|
||||
|
||||
def isBerlinGroupRole(value: String): Boolean = {
|
||||
value match {
|
||||
case SYSTEM_READ_ACCOUNTS_BERLIN_GROUP_VIEW_ID => true
|
||||
case SYSTEM_READ_BALANCES_BERLIN_GROUP_VIEW_ID => true
|
||||
case SYSTEM_READ_TRANSACTIONS_BERLIN_GROUP_VIEW_ID => true
|
||||
case SYSTEM_INITIATE_PAYMENTS_BERLIN_GROUP_VIEW_ID => true
|
||||
case _ => false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
object Util {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user