fix: makes ical url publicly accessible if user has option enabled
This commit is contained in:
@@ -327,4 +327,19 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getCalendarPreferences(): array
|
||||
{
|
||||
return Map::from($this->userPreferences)
|
||||
->rekey(fn(UserPreference $userPreference) => $userPreference->getPreference()->getId())
|
||||
->filter(fn(UserPreference $userPreference) => $userPreference->getPreference()->getType() === 'calendar')
|
||||
->toArray()
|
||||
;
|
||||
}
|
||||
|
||||
public function hasICalEnabled(): bool
|
||||
{
|
||||
return $this->hasUserPreference('enable_ical_up_ep') &&
|
||||
(bool) $this->getUserPreference('enable_ical_up_ep')->getPreferenceValue() === true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user