2019-05-02 04:45:39 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Requests\Api\Client\Servers\Files;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\Server;
|
|
|
|
use Pterodactyl\Http\Requests\Api\Client\ClientApiRequest;
|
|
|
|
|
|
|
|
class CreateFolderRequest extends ClientApiRequest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Checks that the authenticated user is allowed to create files on the server.
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function authorize(): bool
|
|
|
|
{
|
2019-11-04 01:13:47 +00:00
|
|
|
return $this->user()->can('file.create', $this->getModel(Server::class));
|
2019-05-02 04:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function rules(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'root' => 'sometimes|nullable|string',
|
|
|
|
'name' => 'required|string',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|