mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-14 16:52:45 -04:00
- 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
29 lines
810 B
PHP
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');
|
|
}
|
|
}
|