*/
public function setSeed(User $user, Round $round)
{
- return $user->isAdmin() || (!$round->locked && ($user->isRunner($round->tournament) || $user->isTournamentAdmin($round->tournament)));
+ return !$round->locked && ($user->isAdmin() || $user->isRunner($round->tournament) || $user->isTournamentAdmin($round->tournament));
}
/**
*/
public function lock(User $user, Round $round)
{
- return $user->isAdmin() || $user->isTournamentAdmin($round->tournament);
+ return !$round->tournament->locked && ($user->isAdmin() || $user->isTournamentAdmin($round->tournament));
}
/**
*/
public function addRound(User $user, Tournament $tournament)
{
- return $user->isAdmin() || (!$tournament->locked && ($user->isRunner($tournament) || $user->isTournamentAdmin($tournament)));
+ return !$tournament->locked && ($user->isAdmin() || $user->isRunner($tournament) || $user->isTournamentAdmin($tournament));
}
/**
round.results.find(r => r.user_id == user.id && r.has_finished);
export const mayAddRounds = (user, tournament) =>
- isAdmin(user) || (!tournament.locked &&
- (isRunner(user, tournament) || isTournamentAdmin(user, tournament)));
+ !tournament.locked &&
+ (isAdmin(user) || isRunner(user, tournament) || isTournamentAdmin(user, tournament));
export const mayLockRound = (user, tournament) =>
- isAdmin(user) || (!tournament.locked && isTournamentAdmin(user, tournament));
+ !tournament.locked && (isAdmin(user) || isTournamentAdmin(user, tournament));
export const maySetSeed = (user, tournament, round) =>
- isAdmin(user) || (!round.locked &&
- (isRunner(user, tournament) || isTournamentAdmin(user, tournament)));
+ !round.locked &&
+ (isAdmin(user) || isRunner(user, tournament) || isTournamentAdmin(user, tournament));
export const mayViewProtocol = (user, tournament) =>
isAdmin(user) || isTournamentCrew(user, tournament);