2018-01-13 02:39:15 +00:00
|
|
|
<?php
|
|
|
|
|
2018-01-20 01:58:57 +00:00
|
|
|
namespace Pterodactyl\Http\Requests\Api\Application\Users;
|
2018-01-13 02:39:15 +00:00
|
|
|
|
|
|
|
use Pterodactyl\Models\User;
|
|
|
|
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
2018-01-20 03:47:06 +00:00
|
|
|
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
|
2018-01-13 02:39:15 +00:00
|
|
|
|
2018-01-20 03:47:06 +00:00
|
|
|
class StoreUserRequest extends ApplicationApiRequest
|
2018-01-13 02:39:15 +00:00
|
|
|
{
|
2021-01-24 01:17:35 +00:00
|
|
|
protected string $resource = AdminAcl::RESOURCE_USERS;
|
|
|
|
protected int $permission = AdminAcl::WRITE;
|
2018-01-13 02:39:15 +00:00
|
|
|
|
2018-02-04 21:38:38 +00:00
|
|
|
public function rules(array $rules = null): array
|
2018-01-13 02:39:15 +00:00
|
|
|
{
|
2019-09-05 05:26:28 +00:00
|
|
|
$rules = $rules ?? User::getRules();
|
2018-02-04 21:38:38 +00:00
|
|
|
|
|
|
|
$response = collect($rules)->only([
|
2018-01-13 02:39:15 +00:00
|
|
|
'external_id',
|
|
|
|
'email',
|
|
|
|
'username',
|
|
|
|
'password',
|
|
|
|
'language',
|
2021-07-25 21:59:58 +00:00
|
|
|
'admin_role_id',
|
2018-01-13 02:39:15 +00:00
|
|
|
])->toArray();
|
2018-02-04 21:38:38 +00:00
|
|
|
|
|
|
|
return $response;
|
|
|
|
}
|
|
|
|
|
2021-01-24 01:17:35 +00:00
|
|
|
public function attributes(): array
|
2018-01-13 02:39:15 +00:00
|
|
|
{
|
|
|
|
return [
|
|
|
|
'external_id' => 'Third Party Identifier',
|
|
|
|
'root_admin' => 'Root Administrator Status',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|