From f0e510946e01894586db6fe1398ca80d311a9e3d Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Thu, 2 Jul 2020 15:34:01 +0200 Subject: [PATCH] let tournament managers edit team battles --- app/controllers/Tournament.scala | 2 +- app/views/tournament/side.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/Tournament.scala b/app/controllers/Tournament.scala index 53523dcea5..c37a75c62f 100644 --- a/app/controllers/Tournament.scala +++ b/app/controllers/Tournament.scala @@ -345,7 +345,7 @@ final class Tournament( Auth { implicit ctx => me => repo byId id flatMap { _ ?? { - case tour if tour.createdBy == me.id => + case tour if tour.createdBy == me.id || isGranted(_.ManageTournament) => tour.teamBattle ?? { battle => env.team.teamRepo.byOrderedIds(battle.sortedTeamIds) flatMap { teams => env.user.lightUserApi.preloadMany(teams.map(_.createdBy)) >> { diff --git a/app/views/tournament/side.scala b/app/views/tournament/side.scala index 98f574271c..391c9d64da 100644 --- a/app/views/tournament/side.scala +++ b/app/views/tournament/side.scala @@ -115,7 +115,7 @@ object side { st.section(cls := "team-battle")( p(cls := "team-battle__title text", dataIcon := "f")( s"Battle of ${battle.teams.size} teams and ${battle.nbLeaders} leaders", - ctx.userId.has(tour.createdBy) option + (ctx.userId.has(tour.createdBy) || isGranted(_.ManageTournament)) option a(href := routes.Tournament.teamBattleEdit(tour.id), title := "Edit team battle")(iconTag("%")) ) )