feature/viewPermission store snake case instead of camel case in database - step4

This commit is contained in:
hongwei 2025-07-11 19:12:54 +02:00
parent 103914dcea
commit 177f6f3e2a
2 changed files with 6 additions and 0 deletions

View File

@ -37,6 +37,8 @@ object BalanceNewStyle {
Future {
val (views, accountAccesses) = Views.views.vend.privateViewsUserCanAccessAtBank(user, bankId)
// Filter views which can read the balance
// println("xxxxxxx")
println(views.map(_.allowed_actions))
val canSeeBankAccountBalanceViews = views.filter(_.allowed_actions.exists( _ == CAN_SEE_BANK_ACCOUNT_BALANCE))
// Filter accounts the user has permission to see balances and remove duplicates
val allowedAccounts = APIUtil.intersectAccountAccessAndView(accountAccesses, canSeeBankAccountBalanceViews)

View File

@ -71,6 +71,10 @@ object LocalMappedConnectorInternal extends MdcLoggable {
fromBankIdAccountId = BankIdAccountId(fromAccount.bankId, fromAccount.accountId)
view <- NewStyle.function.checkAccountAccessAndGetView(viewId, fromBankIdAccountId, Full(user), callContext)
_ <- Helper.booleanToFuture(InsufficientAuthorisationToCreateTransactionRequest, cc = callContext) {
// println("xxxxxxxxx")
// println(view.allowed_actions)
// println(CAN_ADD_TRANSACTION_REQUEST_TO_ANY_ACCOUNT)
// println(view.allowed_actions.exists(_ ==CAN_ADD_TRANSACTION_REQUEST_TO_ANY_ACCOUNT))
view.allowed_actions.exists(_ ==CAN_ADD_TRANSACTION_REQUEST_TO_ANY_ACCOUNT)
}