<?php

namespace App\Modules\Settings\Rbac\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Password;

class ResetTenantUserPasswordRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()?->can('settings.users.assign_roles') ?? false;
    }

    /**
     * @return array<string, mixed>
     */
    public function rules(): array
    {
        return [
            'password' => ['required', 'confirmed', Password::defaults()],
        ];
    }
}
