Skip to content

Commit d373815

Browse files
committed
refactor: Add authorization check in ExecuteContainerCommand mount method
1 parent 8bb8a7f commit d373815

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/Livewire/Project/Shared/ExecuteContainerCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class ExecuteContainerCommand extends Component
3333

3434
public function mount()
3535
{
36+
if (! auth()->user()->isAdmin()) {
37+
abort(403);
38+
}
3639
$this->parameters = get_route_parameters();
3740
$this->containers = collect();
3841
$this->servers = collect();
@@ -130,7 +133,6 @@ public function connectToContainer()
130133
{
131134
try {
132135
$container_name = data_get($this->container, 'container.Names');
133-
ray($this->container);
134136
if (is_null($container_name)) {
135137
throw new \RuntimeException('Container not found.');
136138
}

0 commit comments

Comments
 (0)