let tournament managers edit team battles
parent
49ffc64fd0
commit
f0e510946e
|
@ -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)) >> {
|
||||
|
|
|
@ -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("%"))
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue