X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fhelpers%2Fpermissions.js;h=4ce6935d83054ebb8bcb4e127166c53a0f181698;hb=a439a2eb428e8f881fd6ed6309e600a664c9b3de;hp=cde0d05d7fd293f7114b6d7553ffb1144a9ffaa6;hpb=3a774bb649734fc3a2135ec1b52cef9a049880ee;p=alttp.git diff --git a/resources/js/helpers/permissions.js b/resources/js/helpers/permissions.js index cde0d05..4ce6935 100644 --- a/resources/js/helpers/permissions.js +++ b/resources/js/helpers/permissions.js @@ -58,6 +58,9 @@ 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 mayLockRound = (user, tournament) => !tournament.locked && isTournamentAdmin(user, tournament); @@ -65,6 +68,9 @@ 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);