let tournament managers edit team battles

pull/6927/head
Thibault Duplessis 2020-07-02 15:34:01 +02:00
parent 49ffc64fd0
commit f0e510946e
2 changed files with 2 additions and 2 deletions

View File

@ -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)) >> {

View File

@ -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("%"))
)
)