2021-01-05 21:52:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Requests\Api\Application\Databases;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\DatabaseHost;
|
|
|
|
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
|
|
|
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
|
|
|
|
|
|
|
|
class DeleteDatabaseRequest extends ApplicationApiRequest
|
|
|
|
{
|
2021-01-24 01:17:35 +00:00
|
|
|
protected string $resource = AdminAcl::RESOURCE_DATABASE_HOSTS;
|
|
|
|
protected int $permission = AdminAcl::WRITE;
|
2021-01-05 21:52:49 +00:00
|
|
|
|
|
|
|
public function resourceExists(): bool
|
|
|
|
{
|
2021-01-09 16:38:50 +00:00
|
|
|
$databaseHost = $this->route()->parameter('databaseHost');
|
2021-01-05 21:52:49 +00:00
|
|
|
|
2021-01-09 16:38:50 +00:00
|
|
|
return $databaseHost instanceof DatabaseHost && $databaseHost->exists;
|
2021-01-05 21:52:49 +00:00
|
|
|
}
|
|
|
|
}
|