user(); if (! $user instanceof PlatformUser) { return false; } return $user->hasCapability(PlatformCapabilities::OPS_VIEW) && $user->hasCapability(PlatformCapabilities::RUNBOOKS_VIEW); } public function mount(OperationRun $run): void { $platformTenant = Tenant::query()->where('external_id', 'platform')->first(); $workspaceId = $platformTenant instanceof Tenant ? (int) $platformTenant->workspace_id : null; $run->load('tenant'); if ($workspaceId === null || (int) $run->workspace_id !== $workspaceId) { abort(404); } if ((string) $run->type !== FindingsLifecycleBackfillRunbookService::RUNBOOK_KEY) { abort(404); } $this->run = $run; } }