From 6a43747fd55bd08d8abeaf27b3110c5f1c9fd2b9 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Tue, 25 Nov 2025 13:24:02 +0100 Subject: [PATCH] allow tournament admins access to hidden results --- app/Models/Result.php | 7 ++++++- app/Policies/RoundPolicy.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Models/Result.php b/app/Models/Result.php index 7a2d7f1..421b813 100644 --- a/app/Models/Result.php +++ b/app/Models/Result.php @@ -89,10 +89,14 @@ class Result extends Model return $this->belongsTo(User::class); } - public function getHasFinishedAttribute() { + public function getHasFinishedAttribute(): bool { return $this->time > 0 || $this->forfeit; } + public function getHasVodAttribute(): bool { + return !empty($this->vod); + } + protected $casts = [ 'forfeit' => 'boolean', @@ -102,6 +106,7 @@ class Result extends Model protected $appends = [ 'has_finished', + 'has_vod', ]; protected $fillable = [ diff --git a/app/Policies/RoundPolicy.php b/app/Policies/RoundPolicy.php index 0d928dd..40373b1 100644 --- a/app/Policies/RoundPolicy.php +++ b/app/Policies/RoundPolicy.php @@ -106,7 +106,7 @@ class RoundPolicy } if ( $round->locked || - ($user && $user->isTournamentMonitor($round->tournament)) || + ($user && $user->isTournamentCrew($round->tournament)) || $round->isComplete() ) { return true; -- 2.47.3