X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fhelpers%2Fpermissions.js;h=23272d9ac14b0f561d53b1507d5fda79453d4d1d;hb=beccf752aafd468c3753c6d48ae30bccd946c3b9;hp=b7d7cfdd616b72ba5a0f271805e87e19d708d61d;hpb=a907ef7c6676fef11f42933b2d79bdd496b20122;p=alttp.git diff --git a/resources/js/helpers/permissions.js b/resources/js/helpers/permissions.js index b7d7cfd..23272d9 100644 --- a/resources/js/helpers/permissions.js +++ b/resources/js/helpers/permissions.js @@ -18,7 +18,7 @@ export const hasFinished = (user, round) => round.results.find(r => r.user_id == user.id && r.has_finished); export const mayAddRounds = (user, tournament) => - isAdmin(user) || isParticipant(user, tournament); + isAdmin(user) || (!tournament.locked && isParticipant(user, tournament)); export const maySetSeed = (user, tournament) => isAdmin(user) || isParticipant(user, tournament); @@ -28,3 +28,8 @@ export const mayViewProtocol = user => export const maySeeResults = (user, tournament, round) => isAdmin(user) || hasFinished(user, round) || Round.isComplete(tournament, round); + +// Users + +export const mayEditStreamLink = (user, subject) => + isAdmin(user) || isSameUser(user, subject);