Skip to content

Commit

Permalink
refactor/tweak the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hongwei1 committed Apr 4, 2024
1 parent 33ab82a commit 25a5ccb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions obp-api/src/main/scala/code/api/util/APIUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4080,7 +4080,7 @@ object APIUtil extends MdcLoggable with CustomJsonFormats{
//all the permission this user have for the bankAccount
val permission: Box[Permission] = Views.views.vend.permission(BankIdAccountId(bankId, accountId), user)

//1. if targetViewId is systemView. just compare all the permissions
//1. If targetViewId is systemView. just compare all the permissions
if(isValidSystemViewId(targetViewId.value)){
val allCanGrantAccessToViewsPermissions: List[String] = permission
.map(_.views.map(_.canGrantAccessToViews.getOrElse(Nil)).flatten).getOrElse(Nil).distinct
Expand All @@ -4099,7 +4099,7 @@ object APIUtil extends MdcLoggable with CustomJsonFormats{
//1st: get the view
val view: Box[View] = Views.views.vend.getViewByBankIdAccountIdViewIdUserPrimaryKey(bankIdAccountIdViewId, user.userPrimaryKey)

//2rd: f targetViewId is systemView. we need to check `view.canGrantAccessToSystemViews` field.
//2rd: If targetViewId is systemView. we need to check `view.canGrantAccessToViews` field.
if(isValidSystemViewId(targetViewId.value)){
val canGrantAccessToSystemViews: Box[List[String]] = view.map(_.canGrantAccessToViews.getOrElse(Nil))
canGrantAccessToSystemViews.getOrElse(Nil).contains(targetViewId.value)
Expand Down Expand Up @@ -4137,7 +4137,7 @@ object APIUtil extends MdcLoggable with CustomJsonFormats{
//1st: get the view
val view: Box[View] = Views.views.vend.getViewByBankIdAccountIdViewIdUserPrimaryKey(bankIdAccountIdViewId, user.userPrimaryKey)

//2rd: f targetViewId is systemView. we need to check `view.canGrantAccessToSystemViews` field.
//2rd: If targetViewId is systemView. we need to check `view.canGrantAccessToViews` field.
if (isValidSystemViewId(targetViewId.value)) {
val canRevokeAccessToSystemViews: Box[List[String]] = view.map(_.canRevokeAccessToViews.getOrElse(Nil))
canRevokeAccessToSystemViews.getOrElse(Nil).contains(targetViewId.value)
Expand All @@ -4152,7 +4152,7 @@ object APIUtil extends MdcLoggable with CustomJsonFormats{
//all the permission this user have for the bankAccount
val permission: Box[Permission] = Views.views.vend.permission(BankIdAccountId(bankId, accountId), user)

//1. if targetViewId is systemView. just compare all the permissions
//1. If targetViewId is systemView. just compare all the permissions
if (isValidSystemViewId(targetViewId.value)) {
val allCanRevokeAccessToSystemViews: List[String] = permission
.map(_.views.map(_.canRevokeAccessToViews.getOrElse(Nil)).flatten).getOrElse(Nil).distinct
Expand Down

0 comments on commit 25a5ccb

Please sign in to comment.