+ !tournament.locked &&
+ (isRunner(user, tournament) || isTournamentAdmin(user, tournament));
+
+export const mayApply = (user, tournament) =>
+ user && tournament && tournament.accept_applications &&
+ !isRunner(user, tournament) && !isApplicant(user, tournament);
+
+export const mayHandleApplications = (user, tournament) =>
+ tournament && tournament.accept_applications && isTournamentAdmin(user, tournament);
+
+export const mayReportResult = (user, tournament) => {
+ if (!user || !tournament) return false;
+ if (tournament.type === 'open-async') return true;
+ return isRunner(user, tournament);
+};
+
+export const mayEditRound = (user, tournament) =>
+ !tournament.locked && isTournamentAdmin(user, tournament);
+
+export const mayLockRound = (user, tournament) =>
+ !tournament.locked && isTournamentAdmin(user, tournament);
+
+export const maySetSeed = (user, tournament, round) =>
+ !round.locked &&
+ (isRunner(user, tournament) || isTournamentAdmin(user, tournament));
+
+export const mayUpdateTournament = (user, tournament) =>
+ isAdmin(user) || isTournamentAdmin(user, tournament);
+
+export const mayViewProtocol = (user, tournament) =>
+ isTournamentCrew(user, tournament);
+
+export const maySeeResults = (user, tournament, round) =>
+ round.locked ||
+ hasFinished(user, round) ||
+ isTournamentMonitor(user, tournament) ||
+ Round.isComplete(tournament, round);
+
+// Users