]> git.localhorst.tv Git - alttp.git/commitdiff
allow tournament admins access to hidden results
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 25 Nov 2025 12:24:02 +0000 (13:24 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 25 Nov 2025 12:24:02 +0000 (13:24 +0100)
app/Models/Result.php
app/Policies/RoundPolicy.php

index 7a2d7f1af4039910da5dc6d5c5d0242c5dd8a007..421b813353962bf11c64c7f82972481d1dfa668e 100644 (file)
@@ -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 = [
index 0d928ddd662f43980816fed7c532810be846210f..40373b147ec8deaea748ba25d57f7d0614963145 100644 (file)
@@ -106,7 +106,7 @@ class RoundPolicy
                }
                if (
                        $round->locked ||
-                       ($user && $user->isTournamentMonitor($round->tournament)) ||
+                       ($user && $user->isTournamentCrew($round->tournament)) ||
                        $round->isComplete()
                ) {
                        return true;