Merge remote-tracking branch 'origin/next' into automation/sync-main-to-next

This commit is contained in:
Andras Bacsai
2026-10-26 12:40:59 +01:00
134 changed files with 4031 additions and 1325 deletions
+12 -1
View File
@@ -13,6 +13,7 @@ use App\Models\ApplicationPreview;
use App\Models\Server;
use App\Models\Service;
use App\Models\Tag;
use App\Services\Access\AccessResolver;
use App\Support\ResourceStartActivity;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Http\Request;
@@ -74,7 +75,12 @@ class DeployController extends Controller
if (is_null($teamId)) {
return invalidTokenResponse();
}
$deployments_per_server = ApplicationDeploymentQueue::ownedByTeam((int) $teamId)->whereIn('status', ['in_progress', 'queued'])->get()->sortBy('id');
$query = ApplicationDeploymentQueue::ownedByTeam((int) $teamId)->whereIn('status', ['in_progress', 'queued']);
if (! app(AccessResolver::class)->coversWholeTeam($request->user(), $teamId)) {
// application_id is a string column, so compare with string IDs of the applications the actor can see.
$query->whereIn('application_id', Application::ownedByCurrentTeamAPI($teamId)->pluck('id')->map(fn ($id) => (string) $id));
}
$deployments_per_server = $query->get()->sortBy('id');
$deployments_per_server = $deployments_per_server->map(function ($deployment) {
return $this->removeSensitiveData($deployment);
});
@@ -232,6 +238,11 @@ class DeployController extends Controller
if (! $application || data_get($application->team(), 'id') !== (int) $teamId) {
return response()->json(['message' => 'You do not have permission to cancel this deployment.'], 403);
}
// For an actor limited by access grants, deployments of applications outside the grants do not exist.
// Soft-deleted applications stay included so a deploy that runs during a delete can still be cancelled.
if (! app(AccessResolver::class)->coversWholeTeam($request->user(), $teamId)) {
$this->authorize('deploy', $application);
}
// Check if deployment can be cancelled (must be queued or in_progress)
$cancellableStatuses = [