More logic for deleting databases
This commit is contained in:
parent
9be2aa4ca9
commit
0999ec93c3
5 changed files with 68 additions and 35 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue