diff --git a/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala b/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala index c7f117117..943b7d8c0 100644 --- a/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala +++ b/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala @@ -136,6 +136,7 @@ object SwaggerDefinitionsJSON { which_alias_to_use = "family", hide_metadata_if_alias_used = false, allowed_actions = List( + CAN_EDIT_OWNER_COMMENT, CAN_SEE_TRANSACTION_THIS_BANK_ACCOUNT, CAN_SEE_TRANSACTION_OTHER_BANK_ACCOUNT, CAN_SEE_TRANSACTION_METADATA, diff --git a/obp-api/src/main/scala/code/api/util/newstyle/BalanceNewStyle.scala b/obp-api/src/main/scala/code/api/util/newstyle/BalanceNewStyle.scala index 21b29039c..ecee3e4c3 100644 --- a/obp-api/src/main/scala/code/api/util/newstyle/BalanceNewStyle.scala +++ b/obp-api/src/main/scala/code/api/util/newstyle/BalanceNewStyle.scala @@ -37,10 +37,11 @@ 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 viewsWithActions = views.map(view => (view, view.allowed_actions)) + val canSeeBankAccountBalanceViews = viewsWithActions.filter { + case (_, actions) => actions.contains(CAN_SEE_BANK_ACCOUNT_BALANCE) + }.map(_._1) val allowedAccounts = APIUtil.intersectAccountAccessAndView(accountAccesses, canSeeBankAccountBalanceViews) allowedAccounts } map { diff --git a/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnectorInternal.scala b/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnectorInternal.scala index 51db97dbd..6fefe90b9 100644 --- a/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnectorInternal.scala +++ b/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnectorInternal.scala @@ -71,11 +71,8 @@ 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) + val allowed_actions = view.allowed_actions + allowed_actions.exists(_ ==CAN_ADD_TRANSACTION_REQUEST_TO_ANY_ACCOUNT) } (paymentLimit, callContext) <- Connector.connector.vend.getPaymentLimit(