refactor: Add authorization check in ExecuteContainerCommand mount method
This commit is contained in:
parent
8bb8a7faa3
commit
d373815f98
1 changed files with 3 additions and 1 deletions
|
|
@ -33,6 +33,9 @@ class ExecuteContainerCommand extends Component
|
||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
|
if (! auth()->user()->isAdmin()) {
|
||||||
|
abort(403);
|
||||||
|
}
|
||||||
$this->parameters = get_route_parameters();
|
$this->parameters = get_route_parameters();
|
||||||
$this->containers = collect();
|
$this->containers = collect();
|
||||||
$this->servers = collect();
|
$this->servers = collect();
|
||||||
|
|
@ -130,7 +133,6 @@ public function connectToContainer()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$container_name = data_get($this->container, 'container.Names');
|
$container_name = data_get($this->container, 'container.Names');
|
||||||
ray($this->container);
|
|
||||||
if (is_null($container_name)) {
|
if (is_null($container_name)) {
|
||||||
throw new \RuntimeException('Container not found.');
|
throw new \RuntimeException('Container not found.');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue