Add ability for user to change server's name

This commit is contained in:
Dane Everitt 2019-12-09 22:03:10 -08:00
parent 564d947f7e
commit 81bd67cc76
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
7 changed files with 168 additions and 3 deletions

View file

@ -0,0 +1,34 @@
<?php
namespace Pterodactyl\Http\Requests\Api\Client\Servers\Settings;
use Pterodactyl\Models\Server;
use Pterodactyl\Contracts\Http\ClientPermissionsRequest;
use Pterodactyl\Http\Requests\Api\Client\ClientApiRequest;
class RenameServerRequest extends ClientApiRequest implements ClientPermissionsRequest
{
/**
* Returns the permissions string indicating which permission should be used to
* validate that the authenticated user has permission to perform this action aganist
* the given resource (server).
*
* @return string
*/
public function permission(): string
{
return 'settings.rename';
}
/**
* The rules to apply when validating this request.
*
* @return array
*/
public function rules(): array
{
return [
'name' => Server::getRules()['name'],
];
}
}