From: Daniel Karbach Date: Tue, 25 Nov 2025 12:24:02 +0000 (+0100) Subject: allow tournament admins access to hidden results X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=6a43747fd55bd08d8abeaf27b3110c5f1c9fd2b9;p=alttp.git allow tournament admins access to hidden results --- 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;