File transfer
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @author Ball Studios <https://git.balls.studio>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
namespace Pterodactyl\Addons\AdvancedAdmin\Http\Requests\Roles;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CreateRoleRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user() && $this->user()->root_admin;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:100',
|
||||
'description' => 'nullable|string|max:500',
|
||||
'color' => 'nullable|string|regex:/^#[0-9a-fA-F]{6}$/',
|
||||
'priority' => 'nullable|integer|min:0|max:9999',
|
||||
'is_default' => 'nullable|boolean',
|
||||
'permissions' => 'nullable|array',
|
||||
'permissions.*' => 'in:allow,deny',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user