misc_pterodactyl-panel/app/Http/Requests/Api/Client/Servers/Databases/RotatePasswordRequest.php

20 lines
469 B
PHP
Raw Normal View History

2019-07-27 22:17:50 +00:00
<?php
namespace Pterodactyl\Http\Requests\Api\Client\Servers\Databases;
use Pterodactyl\Models\Server;
use Pterodactyl\Http\Requests\Api\Client\ClientApiRequest;
class RotatePasswordRequest extends ClientApiRequest
{
/**
* Check that the user has permission to rotate the password.
*
* @return bool
*/
public function authorize(): bool
{
return $this->user()->can('reset-db-password', $this->getModel(Server::class));
}
}