From b2c81eced551176be5f32c046b4f432fb7c42dc3 Mon Sep 17 00:00:00 2001 From: hongwei Date: Tue, 30 Jul 2024 10:46:47 +0200 Subject: [PATCH] feature/added orignal user to callContext --- obp-api/src/main/scala/code/api/util/ConsentUtil.scala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/obp-api/src/main/scala/code/api/util/ConsentUtil.scala b/obp-api/src/main/scala/code/api/util/ConsentUtil.scala index 1b8781fe0c..3e30ea8f93 100644 --- a/obp-api/src/main/scala/code/api/util/ConsentUtil.scala +++ b/obp-api/src/main/scala/code/api/util/ConsentUtil.scala @@ -461,9 +461,14 @@ object Consent extends MdcLoggable { case Full(user) => // 3. Copy Auth Context to the User copyAuthContextOfConsentToUser(consent.jti, user.userId, newUser) match { - case Full(_) => + case Full(_) =>{ // 4. Assign views to the User - (grantAccessToViews(user, consent), Some(cc)) + val originalUserId = consent.toConsent().createdByUserId + val originalUser = Users.users.vend.getUserByUserId(originalUserId) + grantAccessToViews(user, consent) + //For Berlin Group Consent, we return orignal user instead of consent user + (originalUser, Some(cc)) + } case failure@Failure(_, _, _) => // Handled errors (failure, Some(callContext)) case _ =>