]> git.localhorst.tv Git - alttp.git/commitdiff
tournament permissions cleanup
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 3 Feb 2026 15:04:50 +0000 (16:04 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 3 Feb 2026 15:06:58 +0000 (16:06 +0100)
app/Policies/RoundPolicy.php
app/Policies/TournamentPolicy.php
resources/js/helpers/permissions.js

index 3afff4aebfe839389df095b63ef454eea94855d4..cb33e0b2abd3510a36c148e66567e2a0a950be65 100644 (file)
@@ -129,7 +129,7 @@ class RoundPolicy
         */
        public function setSeed(User $user, Round $round)
        {
-               return !$round->locked && ($user->isRunner($round->tournament) || $user->isTournamentAdmin($round->tournament));
+               return !$round->locked && $user->isTournamentAdmin($round->tournament);
        }
 
        /**
index c43af70f8f5c02ab71277caba763974941165015..22854d52cff52d228ef36ea17d085e1fba58bf54 100644 (file)
@@ -101,7 +101,7 @@ class TournamentPolicy
         */
        public function addRound(User $user, Tournament $tournament)
        {
-               return !$tournament->locked && ($user->isRunner($tournament) || $user->isTournamentAdmin($tournament));
+               return !$tournament->locked && $user->isTournamentAdmin($tournament);
        }
 
        /**
@@ -125,7 +125,7 @@ class TournamentPolicy
         */
        public function viewProtocol(User $user, Tournament $tournament)
        {
-               return $user->isTournamentCrew($tournament);
+               return $user->isAdmin() || $user->isTournamentCrew($tournament);
        }
 
        /**
index 4f0ce280dd14ec8175580f0a00ccf66b672ae586..2ec88cea74f8fabb623eb86bf15bbf26d53f1bd5 100644 (file)
@@ -153,8 +153,7 @@ export const hasFinished = (user, round) =>
        round.results.find(r => r.user_id == user.id && r.has_finished);
 
 export const mayAddRounds = (user, tournament) =>
-       !tournament.locked &&
-               (isRunner(user, tournament) || isTournamentAdmin(user, tournament));
+       !tournament.locked && isTournamentAdmin(user, tournament);
 
 export const mayApply = (user, tournament) =>
        user && tournament && tournament.accept_applications &&
@@ -182,8 +181,7 @@ export const mayGetSeed = (user, tournament, round) =>
        round.locked || !tournament.require_auth || !!user;
 
 export const maySetSeed = (user, tournament, round) =>
-       !round.locked &&
-               (isRunner(user, tournament) || isTournamentAdmin(user, tournament));
+       !round.locked && isTournamentAdmin(user, tournament);
 
 export const mayExportTournament = (user, tournament) =>
        isAdmin(user) || isTournamentCrew(user, tournament);
@@ -192,7 +190,7 @@ export const mayUpdateTournament = (user, tournament) =>
        isAdmin(user) || isTournamentAdmin(user, tournament);
 
 export const mayViewProtocol = (user, tournament) =>
-       isTournamentCrew(user, tournament);
+       isAdmin(user) || isTournamentCrew(user, tournament);
 
 export const maySeeRound = (user, tournament, round) => {
        if (!Tournament.hasAssignedGroups(tournament)) {