Files
coolify/app/Livewire/SharedVariables/Environment/Index.php
T
Andras Bacsai fb854a7cff fix(access): hide shared variables and actions that a member cannot use
- Check read access on the project or environment for shared variables
  pages, the canvas, and the sidebar, not only navigation access
- Require team-wide read for the server shared variables canvas API
- Open the environment variable editor read-only when the value is hidden
- Show the integration tokens button only to users who can open it
- Show disabled confirmation buttons as disabled, not as danger buttons
2026-10-30 15:14:02 +01:00

29 lines
810 B
PHP

<?php
namespace App\Livewire\SharedVariables\Environment;
use App\Models\Environment;
use App\Models\Project;
use Illuminate\Support\Collection;
use Livewire\Component;
class Index extends Component
{
public Collection $projects;
public function mount()
{
$this->projects = Project::ownedByCurrentTeamCached()
->each(fn (Project $project) => $project->setRelation('environments', $project->environments
->filter(fn (Environment $environment) => auth()->user()->can('viewSharedVariables', $environment))
->values()))
->filter(fn (Project $project) => $project->environments->isNotEmpty())
->values();
}
public function render()
{
return view('livewire.shared-variables.environment.index');
}
}