Skip to content

Commit

Permalink
feature/added orignal user to callContext
Browse files Browse the repository at this point in the history
  • Loading branch information
hongwei1 committed Jul 30, 2024
1 parent 65142f5 commit b2c81ec
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions obp-api/src/main/scala/code/api/util/ConsentUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 _ =>
Expand Down

0 comments on commit b2c81ec

Please sign in to comment.