Skip to content

Commit

Permalink
#1410 Hide invisible organistions
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jul 22, 2020
1 parent fc9262d commit 4560cbc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions thehive/app/org/thp/thehive/services/UserSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,12 @@ class UserSteps(raw: GremlinScala[Vertex])(implicit @Named("with-thehive-schema"
.project(
_.by
.by(_.avatar.fold)
.by(_.role.project(_.by(_.profile).by(_.organisation.name)).fold)
.by(_.role.project(_.by(_.profile).by(_.organisation.visible.name.fold)).fold)
)
.map {
case (user, attachment, profileOrganisations) =>
val po = profileOrganisations.asScala.map {
case (profile, organisationName) => profile.as[Profile] -> organisationName
val po = profileOrganisations.asScala.collect {
case (profile, organisationName) if !organisationName.isEmpty => profile.as[Profile] -> organisationName.get(0)
}
po.find(_._2 == authContext.organisation)
.orElse(po.headOption)
Expand Down

0 comments on commit 4560cbc

Please sign in to comment.