Skip to content

Commit

Permalink
#1316 When user is in several organisations, select the oldest one at…
Browse files Browse the repository at this point in the history
… login
  • Loading branch information
To-om committed May 26, 2020
1 parent 65309cf commit f5db0e5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions thehive/app/org/thp/thehive/services/UserSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import java.util.regex.Pattern

import gremlin.scala._
import javax.inject.{Inject, Singleton}
import org.apache.tinkerpop.gremlin.process.traversal.Order
import org.thp.scalligraph.auth.{AuthContext, AuthContextImpl, Permission}
import org.thp.scalligraph.controllers.FFile
import org.thp.scalligraph.models._
Expand Down Expand Up @@ -208,6 +209,7 @@ class UserSteps(raw: GremlinScala[Vertex])(implicit db: Database, graph: Graph)
this
.newInstance()
.outTo[UserRole]
.order(List(By(Key[Long]("_createdAt"), Order.asc)))
.outTo[RoleOrganisation]
.value[String](Key("name"))
.headOption()
Expand Down

0 comments on commit f5db0e5

Please sign in to comment.