Skip to content

Commit

Permalink
Permettre à l'expert d'inviter quelqu'un dans le territoire courant (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jdauphant authored Mar 13, 2020
1 parent ab6a7cb commit d6116df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/controllers/ApplicationController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,11 @@ case class ApplicationController @Inject() (
private def usersWhoCanBeInvitedOn[A](
application: Application
)(implicit request: RequestWithUserData[A]): Future[List[User]] =
(if (request.currentUser.instructor || request.currentUser.expert) {
(if (request.currentUser.expert) {
userGroupService.byArea(request.currentArea.id).map { groupsOfArea =>
userService.byGroupIds(groupsOfArea.map(_.id)).filter(_.instructor)
}
} else if (request.currentUser.instructor) {
userGroupService.byArea(application.area).map { groupsOfArea =>
userService.byGroupIds(groupsOfArea.map(_.id)).filter(_.instructor)
}
Expand Down

0 comments on commit d6116df

Please sign in to comment.