More logic for deleting databases

This commit is contained in:
Dane Everitt 2018-08-25 15:07:42 -07:00
parent 9be2aa4ca9
commit 0999ec93c3
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
5 changed files with 68 additions and 35 deletions

View file

@ -18,15 +18,10 @@ class DeleteDatabaseRequest extends ClientApiRequest implements ClientPermission
}
/**
* Determine if the provided database even belongs to this server instance.
*
* @return bool
*/
public function resourceExists(): bool
{
$server = $this->getModel(Server::class);
$database = $this->getModel(Database::class);
return $database->server_id === $server->id;
return $this->getModel(Server::class)->id === $this->getModel(Database::class)->server_id;
}
}