fix: makes ical url publicly accessible if user has option enabled
This commit is contained in:
29
src/User/Action/Input/SaveUserCalendarPreferencesInput.php
Normal file
29
src/User/Action/Input/SaveUserCalendarPreferencesInput.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Action\Input;
|
||||
|
||||
use App\User\Action\Command\SaveUserCalendarPreferencesCommand;
|
||||
use App\User\Action\Command\SaveUserDownloadPreferencesCommand;
|
||||
use OneToMany\RichBundle\Attribute\SourceRequest;
|
||||
use OneToMany\RichBundle\Attribute\SourceSecurity;
|
||||
use OneToMany\RichBundle\Contract\CommandInterface as C;
|
||||
use OneToMany\RichBundle\Contract\InputInterface;
|
||||
|
||||
/** @implements InputInterface<SaveUserDownloadPreferencesInput, SaveUserDownloadPreferencesCommand> */
|
||||
class SaveUserCalendarPreferencesInput implements InputInterface
|
||||
{
|
||||
public function __construct(
|
||||
#[SourceSecurity]
|
||||
public mixed $userId,
|
||||
|
||||
#[SourceRequest('enable_ical_up_ep', nullify: true)]
|
||||
public bool $enableIcalUpcomingEpisodes,
|
||||
) {}
|
||||
|
||||
public function toCommand(): C
|
||||
{
|
||||
return new SaveUserCalendarPreferencesCommand(
|
||||
$this->enableIcalUpcomingEpisodes,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user